W willisgt Active Member Licensed User Mar 24, 2008 #1 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:
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 B4X founder Staff member Licensed User Longtime User Mar 24, 2008 #2 B4PObject(5) is actually a reference to the main form. You should show the form before this line.
W willisgt Active Member Licensed User Mar 24, 2008 #3 *sigh* It's always the little details... :sign0161:
H Hai-DJ New Member Licensed User Longtime User Jun 29, 2008 #4 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 )
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 )