Search code examples
androidimagedrawableresolutionscreen-density

Can I keep fix the same resolution of the same image when the devices have different densities?


I asked a question yesterday.

Why do resolutions become smaller after a image file be read by program?

Very thanks the people helped me.

They let me know that if I use the devices having different densities, the resolutions of the same image may be changed.

For example:

I have a image with resolution 1440x2560 and a device with density 3.5.

The revolution will become 1260x2240 after the image be read into the program.

But I don't want the resolutions of the images to be changed, because the proportion of the images on the screen will be different.

I tried to find a solution, but I failed.

Is there a convenient way to fix the same resolution of the same image on the different devices with different densities?


Solution

  • If you want your images to be adjusted by Android, I understand they are drawables even if you didn't explicitly mention it, add them to the drawable-nodpi directory.