what resolution tu use for my images

柔情痞子 提交于 2019-12-24 19:01:33

问题


I'm creating an android application that will contain many imageButtons. I want to create images by photoshop, what resolution should I use so images will be displayed correctly in most devices? For exemple, for web images we use 72.


回答1:


DPI or PPI it doesn't matter.. Basically u should care about it just if u want to print something. If u prepare graphic elements for Android App u should care about dimensions of PNGs in pixels(px). If u develop for more then one device, which is probably the case u should prepare different size images for different screens. Google generalized screens densities to ldpi, mdpi, hdpi, xhdpi. Medium density (mdpi ~160dpi) is used as base density and others are derived from it as follows:

ldpi = 0.75 x mdpi
hdpi = 1.5 x mdpi
xhdpi = 2.0 x mdpi

this basically means if u had image of 100x100px and u want that one to look nice on hdpi screen u should provide same image in 150x150px abd save in drawable-hdpi directory. Android will do the rest and make both images look same on appropriate screen.

So before start with graphics design:

  • check which category is device u r developing on,
  • check which devices u want to support (this dashboards by Google will be useful),
  • design,
  • test (try AndroidDesignPreview),
  • publish

On the other side, Google generalized screen sizes as well so we have small, normal, large, xlarge.. For support different sizes u should define different layouts and how elements will be positioned in them.

To read and learn more about whole thing, try to check this link of official Android documentation.

Hope u will find answer useful ;) Enjoy Android wonderland.. ;) Cheers




回答2:


Resolution doesn't matter as it's a purely digital medium. If you make something 300px wide, regardless of the resolution, it'll be 300 pixels. The device has a global DPI setting that you can query the system for, but it just uses that to scale images for the display. The DPI settings of your images are not taken into account.



来源:https://stackoverflow.com/questions/8961726/what-resolution-tu-use-for-my-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!