Hey all, I get a fatal null pointer exception whenever I execute the following code:
B4X:
Dim MyCanvas As Canvas
Dim Bitmap1 As Bitmap
Bitmap1.Initialize(File.DirAssets, "logo.png")
Dim DestRect As Rect
DestRect.Initialize(10dip, 10dip, 10dip + 100dip, 10dip + 100dip)
MyCanvas.DrawBitmap(Bitmap1,, DestRect)
Preview.SetBackgroundImage(MyCanvas.Bitmap)
I use
B4X:
Dim Preview As Panel
in Globals. The image logo.png does exist and can be loaded and referenced otherwise.