Android的xdpi文件夹,我的形象是什么尺寸? [英] android xdpi folders, what size for my image?
问题描述
我一直在阅读以下内容: http://developer.android.com/引导/做法/ screens_support.html
I've been reading the following: http://developer.android.com/guide/practices/screens_support.html
这是关于文件夹 RES-长期土地华电国际
, RES-notlong土地-DPI
, RES-notlong端口-LDPI
等。而实际上他们的意思是什么以及何时应该使用。
It's about the folders res-long-land-hdpi
, res-notlong-land-dpi
, res-notlong-port-ldpi
etc. And what they actually mean and when they should be used.
该文章还表示下列内容:
The article also says the following:
- XLARGE屏幕至少960dp点¯x720dp
- 大屏幕至少640dp点¯x480dp
我正在开发的设备为: 1280×720
键,一个是 480 * 800
I'm developing for a device that is: 1280 x 720
and one that is 480 x 800
我的应用程序将只在纵向模式下可用。
My app will only be available in portrait mode.
因此,这意味着我必须把图像中的 RES-长端口华电国际
文件夹中的第一个设备,并在 RES-notlong -port-LDPI
第二个设备吧?
So that means i have to put images in the res-long-port-hdpi
folder for the first device, and in res-notlong-port-ldpi
for the second device right?
那么接下来的问题,我有这个。我有一个形象,这是 332点¯x226
像素。这看起来第一(超大)设备上的罚款。但要做到什么大小我必须重新调整这一形象,使我可以将其放置在(分辨率较低) RES-XX-XX-LDPI
文件夹?
Then the next problem i have with this is. I have an image which is 332 x 226
pixels. This looks fine on the first (xlarge) device. But to what size do i have to rescale this image so that i can place it in the (lower resolution) res-xx-xx-ldpi
folder?
我不知道如何计算新的大小不同的文件夹中。
I'm not sure how to calculate the new sizes for the different folders.
推荐答案
的大小比率应该与标称的像素密度为Android的定义它们:
The size ratios should match the nominal pixel densities as Android defines them:
LDPI - 120像素/英寸; DPI规模= 0.75(4 DPI = 3个像素)结果
MDPI - 160像素/英寸; dpi的比例= 1(1 DPI = 1个像素)搜索
华电国际 - 240像素/英寸; DPI规模= 1.5(2 DPI = 3个像素)结果
xhdpi - 320像素/英寸; DPI规模= 2(1 DPI = 2像素)
ldpi - 120 pixels/inch; dpi scale = .75 (4 dpi = 3 pixels)
mdpi - 160 pixels/inch; dpi scale = 1 (1 dpi = 1 pixel)
hdpi - 240 pixels/inch; dpi scale = 1.5 (2 dpi = 3 pixels)
xhdpi - 320 pixels/inch; dpi scale = 2 (1 dpi = 2 pixels)
所以,如果你让你的xhdpi图像的两倍大小(像素)的MDPI资源,他们将是相同的DPI,这意味着他们将各自的屏幕上的相同的物理尺寸。
So if you make your xhdpi images twice the size (in pixels) of the mdpi resources, they will be the same dpi, meaning they will be the same physical size on their respective screens.
这篇关于Android的xdpi文件夹,我的形象是什么尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!