2

I know there is a lot of stuff related to how does android store images. and what does mhdpi xhdmi lhdpi etc means But my question is a bit different. actually i am working on a screen whose height and weight in px is 720*1020 px. this is not complete HD, this is sort of SD screen. now i designed images for 720*1080 px with size equal to 520*370 px this is the image size. and i have stored the image in xhdmi

The Issue is

When i put the image on screen and give it

android:layout_height = "wrap_content"
android:layout_width = "wrap_content"

the image is displayed on the screen but it shrinks a to half the original size, so i tried giving the height and width equal to 520px and 370px respectively to the layout then i get the original size of image

My question is:

What size should my image contain so that if i wrap content the height and weight, it gets the original size.

Hassaan Rabbani
  • 2,469
  • 5
  • 30
  • 55

1 Answers1

-1

In your case the image is resized based on the screen density of the display. Because you placed the image in a higher density folder than your phone is using it will be downscaled. The forth response from How to resize the bitmap image according to mdpi,hdpi and screen size of the mobile explains how the images scale depending on screen density.

You can consider the density on your device, the size you expect to be and increase the size with a multiplier so you can save it in xhdpi folder.

Community
  • 1
  • 1
azertiti
  • 3,150
  • 17
  • 19
  • Any reason for the negative vote? I agree the accepted answer has more information but that doesn't make this one incorrect. – azertiti Feb 04 '14 at 10:25