Android Question ImageView Gravity Fill Center Crop

scsjc

Well-Known Member
Licensed User
Longtime User
Is it possible to crop the image to maintain the proportion and fill in the maximum imageview space?

1577614026658.png
 

Alexander Stolte

Expert
Licensed User
Longtime User
Is it possible to crop the image to maintain the proportion and fill in the maximum imageview space?
Yes:
B4X:
    Dim xui As XUI
    Dim iv As ImageView
    iv.Initialize("")
    iv.Bitmap = xui.LoadBitmapResize(File.DirAssets,"myimage.png",iv.Width,iv.Height,True)

EDIT: the "true" at the end is important!
 
Upvote 0
Top