Why is my drawer.New2() not working?

willisgt

Active Member
Licensed User
Could someone please tell me why this is producing an error?

bitmapBKG is a bitmap, and background.bmp is a 24-bit BMP.

B4X:
   ' ... background image

   bitmapBKG.New1( AppPath & "\background.bmp" )

   AddObject( "drawerBKG", "Drawer" )
   drawerBKG.New2( bitmapBKG.Value, B4PObject(5) )   '<-- error happens on this line
   
   pen.Color = cCyan   'Rgb( 0, 128, 0 )
The error is: 'Object reference not set to an instance of an object'.

I'm using ImageLib.dll v. 1.0.2860.34398.


Gary

:sign0085:
 

Erel

Administrator
Staff member
Licensed User
B4PObject(5) is actually a reference to the main form.
You should show the form before this line.
 

Hai-DJ

New Member
Licensed User
drawer.New2

Try this:

' ... background image

' make a new image with NEW2

bitmapBKG.New2(width,height)

AddObject( "drawerBKG", "Drawer" )
drawerBKG.New2( bitmapBKG.Value, B4PObject(5) )

pen.Color = cCyan 'Rgb( 0, 128, 0 )
 
Top