Question

I want to use PNG image with fixed pixels on my application. I don't want to add the same image into all folders (ldpi, mdpi, hdpi, xhdpi, xxhdpi and xxxhdpi). Image will get blurred if I just add it into one folder. How do I do it?

Was it helpful?

Solution

You can use drawable-nodpi directory, if I understood your intent correctly. Images in there will be displayed as is on the device, no scaling will be used. That means that it might be really small on some device and/or really large on other devices.

More info in Table 2 here

OTHER TIPS

You can use drawable folder to put your PNG. To prevent from image blurring, use high resolution images(xxxhdpi), and create different layout for each dpi and set size on each image you are using. Hope this trick can help.

Add your 640 dpi image to the drawable-xxxhdpi folder.
It will be scaled DOWN (that is, no blur due to stretch up will occur).
It's always better to scale DOWN rather than UP.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top