Imageview Issue

junaidahmed

Well-Known Member
Licensed User
Longtime User
I am going to load Big image with dimention 639 X 689 in imageview,it display as stretch form,we would like to know how the image should display as actual dimention i.e (Should not be stretch).pls advise.
 

klaus

Expert
Licensed User
Longtime User
You must be more precise on what you have done.
What is your screen size ?
What is the ImageView size ?
Did you set any Gravity parameter ?

The easiert way for us is that you post your code or at least a small test program that shows your problem, so we could see what you have done and how and give you the best advice in a short time.

Best regards.
 
Upvote 0

derez

Expert
Licensed User
Longtime User
You can initialize a bitmap with the file, thus having the size of the image, and then allocate this bitmap to the imageview.
Alternatively - use jpeg library with LoadJpegSizeOnly, then you can set the imageview to the same size and set the image to it.

If the imageview size is fix, you have to draw part of the full image using canvas and drawbitmap, with the source rectangle size set to the imageview size and the origin is set as you wish - starting from the top-left corner or centered ...
 
Last edited:
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
Pls check the attachment and my below code.

Imageview1.Bitmap = LoadPicture("\mnt\sdcard\Photos\03F03ISO.JPG")
Imageview1.Gravity = Gravity.FILL

My scree size is 600 X 1024
 
Last edited:
Upvote 0
Top