简体   繁体   中英

Getting desired size of an image per density

If I have a 500x500px image imported to Android Studio and got ldpi(100x100), mdpi(200x200), hdpi(300x300) and xhdpi(500x500), how can I achieve a 213x213 for mdpi if I base it on a 500x500 image? What formula or graphics editor can I use to do this? I read the docs but haven't found it there.

I have found reasonably good results resizing my master images for the various Android resolutions using Adobe Photoshop. Technically you could just place the 500x500 image into the default resource folder, and Android would automatically scale the image as needed for the particular device. But Android does a rather lousy job of scaling images. Photoshop (or any other decent program) is very good at scaling down (or up), and so gives better results.

I assume here that 500x500 is an appropriate size for xhdpi . Follow the link below for a good reference answer which discusses image sizes in the context of Android resolutions.

Different resolution support android

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