Sub GetBitmapFromView(VwSource As View) As Bitmap
Dim StrMethod As String = "Sub GetBitmapFromView(VwSource As View) As Bitmap"
Dim BmpResult As Bitmap = Null
Try
Dim IntWidth As Int
IntWidth = VwSource.Width
Dim IntHeight As Int
IntHeight = VwSource.Height
Dim Bmp As Bitmap
Bmp.InitializeMutable(IntWidth, IntHeight)
Dim Cnv As Canvas
Cnv.Initialize2(Bmp)
Dim Rfl As Reflector
Rfl.Target = Cnv
Dim AryObjectRef(1) As Object
AryObjectRef = Array As Object (Rfl.GetField("canvas"))
Dim AryObjectTypeRef(1) As String
AryObjectTypeRef = Array As String ("android.graphics.Canvas")
Dim RftView As Reflector
RftView.Target = VwSource
RftView.RunMethod4("draw", AryObjectRef, AryObjectTypeRef)
BmpResult = Bmp
Catch
CdException.Show(StrClass, StrMethod, LastException)
End Try
Return BmpResult
End Sub