简体   繁体   中英

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

mdpi medium density 160 dpi

hdpi high density 240 dpi

xhdpi extra high density 320 dpi

The other is this:

xhdpi: 2.0

hdpi: 1.5

mdpi: 1.0 (baseline)

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

Does it mean that If I take as a baseline 640x360, I have to make following 4 groups of images:

1) ldpi - size 480x270 pixels and density 120 dpi

2) mdpi - size 640x360 pixels and density 160 dpi

3) hdpi - size 960x540 pixels and density 240 dpi

4) xhdpi - size 1280x720 pixels and density 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

eg xhdpi fits 2x the amount of horizontal and vertical pixels into the same space that mdpi would.

mdpi = 160 dpi (scale factor 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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