'This one returns a white image with the selected section on top
Private Sub GetCroppedImage2()
Private rectSource, rectDest As Rect
Private cLeft, cTop As Int
Dim rectImageWidth As Int
Dim rectImageHeight As Int
rectImageWidth = rectImage.Right - rectImage.Left
rectImageHeight = rectImage.Bottom - rectImage.Top
' imvCroped.Height = imvCroped.Width / rectImageWidth * rectImageHeight
#if B4A
imvCroped.Gravity = Gravity.FILL
#else
imvCroped.ContentMode = imvCroped.MODE_FILL
#end If
Private cvsCroped As Canvas
cvsCroped.Initialize(imvCroped)
cLeft = (rectImage.Left - imvImage.Left) * PixelScaleX
cTop = (rectImage.Top - imvImage.Top) * PixelScaleY
rectSource.Initialize(cLeft, cTop, cLeft + rectImageWidth * PixelScaleX, cTop + rectImageHeight * PixelScaleY)
rectDest.Initialize(cLeft, cTop, cLeft + rectImageWidth * PixelScaleX, cTop + rectImageHeight * PixelScaleY)
#if B4A
bmpCroped.InitializeMutable(bmpImage.Width, bmpImage.Height)
cvsCroped.Initialize2(bmpCroped)
cvsCroped.DrawColor(Colors.White)
cvsCroped.DrawBitmap(bmpImage, rectSource, rectDest)
imvCroped.Bitmap = bmpCroped
#else
I am looking for the equivalent code to fill in here
#end if
End Sub