Canvas and LoadImage

BlitzPlus Forums/BlitzPlus Programming/Canvas and LoadImage

MattVonFat(Posted 2004) [#1]
I want to draw an image to the canvas but it doesnt show up.

This is what i use to save the buffer then load the image:
Function buffer_Grab()
	
	SaveBuffer CanvasBuffer(cnvMain), "lspCurr.bmp"
	currentBuffer = LoadImage("lspCurr.bmp")
	
End Function


This is what i use to draw it:
Function draw_Line()

	While WaitEvent() <> $202
	
		If EventID() = $203
			Cls
			DrawImage currentBuffer, 0, 0
			Line mx%, my%, EventX(), EventY()
			FlipCanvas(cnvMain)
		End If
		
	Wend
	buffer_Grab()
	
End Function


The buffer and canvas are global. The image just wont show up! (It is being saved each time but only with the last line drawn.)

Thanks for any help

Matt


PantsOn(Posted 2004) [#2]
try
setbuffer canvasbuffer(cnvMain)

before cls


MattVonFat(Posted 2004) [#3]
Sorry i forgot to mention that the line its self is being drawn. I set the buffer earlier in the code.


MattVonFat(Posted 2004) [#4]
Ok it was a mask problem. I only realised when i tried drawing a diff image and all the black had gone.