scsjc Well-Known Member Licensed User Longtime User Dec 29, 2019 #1 Is it possible to crop the image to maintain the proportion and fill in the maximum imageview space?
Alexander Stolte Expert Licensed User Longtime User Dec 29, 2019 #2 scsjc said: Is it possible to crop the image to maintain the proportion and fill in the maximum imageview space? Click to expand... 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
scsjc said: Is it possible to crop the image to maintain the proportion and fill in the maximum imageview space? Click to expand... 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!
Erel B4X founder Staff member Licensed User Longtime User Dec 29, 2019 #3 [B4X][XUI] Fill and Fit images without distortion Don't use this code. Better solution in B4XImageView (XUI Views) (https://www.b4x.com/android/forum/threads/b4x-b4ximageview-imageview-resize-modes.121359/#content) www.b4x.com Upvote 0
[B4X][XUI] Fill and Fit images without distortion Don't use this code. Better solution in B4XImageView (XUI Views) (https://www.b4x.com/android/forum/threads/b4x-b4ximageview-imageview-resize-modes.121359/#content) www.b4x.com
scsjc Well-Known Member Licensed User Longtime User Dec 29, 2019 #4 Erel said: [B4X][XUI] Fill and Fit images without distortion Don't use this code. Better solution in B4XImageView (XUI Views) (https://www.b4x.com/android/forum/threads/b4x-b4ximageview-imageview-resize-modes.121359/#content) www.b4x.com Click to expand... Perfect, i use the... FitImageToView ... some easy way to change the background color ??? Upvote 0
Erel said: [B4X][XUI] Fill and Fit images without distortion Don't use this code. Better solution in B4XImageView (XUI Views) (https://www.b4x.com/android/forum/threads/b4x-b4ximageview-imageview-resize-modes.121359/#content) www.b4x.com Click to expand... Perfect, i use the... FitImageToView ... some easy way to change the background color ???
Erel B4X founder Staff member Licensed User Longtime User Dec 29, 2019 #5 Put a panel behind the ImageView and set its color. Upvote 0