I have an image in a personal file. I read the file, create the drawing and assigned it an ImageView. ImageView has WRAP_CONTENT, so the size is automatic.
On 320x480 screens, the image looks good. But on screens with high resolution and high density 480x800 or 480x854 (N1, droid), when the image, for example, is 150x150, I see the image as 100x100.
Of course, it has something to do with density, but I'm not sure how to resolve it.
This is my code:
FileInputStream fis = this.openFileInput("icon.png"); icon = Drawable.createFromStream(fis, "icon"); fis.close(); imageView.setImageDrawable(icon);
thanks
==================================================== ===============
update:
with the following code:
FileInputStream fis = this.openFileInput ("icon.png");
icon = Drawable.createFromStream (fis, "icon");
If I then inspect the size of the icon, android thinks the size is 100x100, when really 150x150.
It seems that it reduces the image in density. Can someone explain this and how to avoid it.
thanks
source share