Relation between ImageView's width and its image's width

Inman

Well-Known Member
Licensed User
Longtime User
Here is something that is puzzling me for the last couple of days. I have an ImageView, the gravity of which is set to Center. Now if I load an image with the same width as that of the imageview, shouldn't it display the complete width of the image, irrespective of its height?

Because in my case that is not happening. It instead zooms and crops the image, displaying only a center portion, not the full width. I am using CreateScaledBitmap function given in the following page to make sure the bitmap is upscaled/downscaled to match the width of the imageview.

http://www.b4x.com/forum/basic4android-updates-questions/20643-resizing-image.html#post119006
 

Inman

Well-Known Member
Licensed User
Longtime User
Nah, that is ok. I switched to UltimateListView and using Bitmap Plus library I cropped and resized the image to my needs, instead of setting Gravity.

It was a big project too.
 
Upvote 0
Top