I am having some problems in showing and drawing a bitmap.
Basically I load a bitmap, set it in an ImageView. Now I want to draw the same bitmap to a panel using a canvas. But I want to draw only the part visible in the imageview.
However, it seems the bitmap in the imageview is scaled up (I am not sure if it is losing quality scaling up) and the bitmap drawn by the canvas is not.
Now, this may be related to Density and Scaling, however I am not sure what I am supposed to fix.
- Do I set the bitmap density to 160x2, this causes the ImageView to show a smaller bitmap
- Do I draw using the canvas a bigger image by changing the destRect dimensions by 2.
I know how to get around this, but I do not know what the correct solution is.
Is the ImageView misbehaving or the Canvas?
I attached the sample here to demonstrate the issue (my guess is you will only see it with a device with Density <> 1).
Basically I load a bitmap, set it in an ImageView. Now I want to draw the same bitmap to a panel using a canvas. But I want to draw only the part visible in the imageview.
However, it seems the bitmap in the imageview is scaled up (I am not sure if it is losing quality scaling up) and the bitmap drawn by the canvas is not.
Now, this may be related to Density and Scaling, however I am not sure what I am supposed to fix.
- Do I set the bitmap density to 160x2, this causes the ImageView to show a smaller bitmap
- Do I draw using the canvas a bigger image by changing the destRect dimensions by 2.
I know how to get around this, but I do not know what the correct solution is.
Is the ImageView misbehaving or the Canvas?
I attached the sample here to demonstrate the issue (my guess is you will only see it with a device with Density <> 1).