简体   繁体   English

位图的屏幕尺寸和dpi

[英]Screen size and dpi of bitmaps

I found two approximations of how developer should support bitmaps for different screen sizes. 我发现开发人员应如何支持不同屏幕尺寸的位图有两个近似值。 One is this: 一个是这样的:

ldpi low density 120 dpi ldpi低密度120 dpi

mdpi medium density 160 dpi mdpi中密度160 dpi

hdpi high density 240 dpi hdpi高密度240 dpi

xhdpi extra high density 320 dpi xhdpi超高密度320 dpi

The other is this: 另一个是这样的:

xhdpi: 2.0 xhdpi:2.0

hdpi: 1.5 hdpi:1.5

mdpi: 1.0 (baseline) mdpi:1.0(基准)

ldpi: 0.75 ldpi:0.75

This means that if you generate a 200x200 image for xhdpi devices, you should generate the same resource in 150x150 for hdpi, 100x100 for mdpi and finally a 75x75 image for ldpi devices 这意味着,如果您为xhdpi设备生成200x200的图像,则应以150x150的hdpi,100x100的mdpi以及75x75的ldpi设备生成相同的资源

Does it mean that If I take as a baseline 640x360, I have to make following 4 groups of images: 这是否意味着如果我以640x360为基线,则必须制作以下4组图像:

1) ldpi - size 480x270 pixels and density 120 dpi 1)ldpi-尺寸480x270像素和密度120 dpi

2) mdpi - size 640x360 pixels and density 160 dpi 2)mdpi-尺寸640x360像素,密度160 dpi

3) hdpi - size 960x540 pixels and density 240 dpi 3)hdpi-尺寸960x540像素和密度240 dpi

4) xhdpi - size 1280x720 pixels and density 320 dpi 4)xhdpi-尺寸1280x720像素和密度320 dpi

You are misunderstanding. 你误会了

The documentation is not saying different things. 该文档没有说不同的话。 The second part you reference is telling you how much bigger an image is in relation to the base density of mdpi 您参考的第二部分告诉您相对于mdpi的基本密度而言,图像的大小要大多少

eg xhdpi fits 2x the amount of horizontal and vertical pixels into the same space that mdpi would. 例如,xhdpi使水平和垂直像素的2倍适合mdpi所需要的空间。

mdpi = 160 dpi (scale factor 1) mdpi = 160 dpi(比例因子1)

xhdpi = 320 dpi (x2 twice as dense as mdpi therefore an image in this folder needs to be twice as high and twice as wide as its mdpi counterpart to appear the same size on an xhdpi screen) xhdpi = 320 dpi(x2的密度是mdpi的两倍,因此,此文件夹中的图像必须是其mdpi对应图像的两倍高和两倍,才能在xhdpi屏幕上显示相同的尺寸)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM