My null image a simple problem

BlitzMax Forums/BlitzMax Beginners Area/My null image a simple problem

Dubious Drewski(Posted 2005) [#1]
I seem to be missing something very simple here.
I get the "attempted to access Null object" when my
program gets here:

		DrawImage scenery[3].image,90,90  'this works: the image is drawn
		Flip
		WaitKey
		Local temp = LockImage(scenery[3].image) 
		For Local y = 128 To 0 Step -1    
			WritePixel(temp,0,y,-19540200)  'draw a bright yellow line down the left side of the image
		Next
		UnlockImage(temp) '<-  error here.  Now it's Null....what's going on here?


Can anyone spot my obvious error?


Dubious Drewski(Posted 2005) [#2]
Oh. After 45 minutes...

UnlockImage(temp) should = UnlockImage(scenery[3].image)

Lovely. Sorry for the trouble, fellows.


Matt McFarland(Posted 2005) [#3]
How'd you find this one out?


Dreamora(Posted 2005) [#4]
Reading the help and examine the examples in it on how to use commands if you don't understand it so far.

Beside: Use local temp:TPixmap instead of local temp. Will make it faster.


Dubious Drewski(Posted 2005) [#5]
Matt, I'm not sure if that's sarcasm and therefore, if I should answer.

lol.