LockImage bug?

BlitzMax Forums/BlitzMax Programming/LockImage bug?

Docster(Posted 2010) [#1]
Strict

Local img:TImage
Local pix:TPixmap

img:TImage = CreateImage(512, 512)
pix:TPixmap = LockImage(img)
UnlockImage(pix)

Am I missing something? This won't work/compile. I am getting an error saying: "Unable to convert from 'brl.pixmap.TPixmap' to 'TImage'

----

For Local i = 1 To 10000
Print "test #" + i
change()
Next


Function change()
img = CreateImage(512, 512)
pix = LockImage(img)
WritePixel(pix,100,100,$00FF0000)
UnlockImage(pix)
img=Null
End Function

This gives me a "EXCEPTION_ACCESS_VIOLATION" after 1817 calls to to the change function.

Can anyone confirm this?

Using BlitzMax v1.39

Tnx


plash(Posted 2010) [#2]
You need to unlock the image, not the pixmap.


Docster(Posted 2010) [#3]
Bah. I knew something was strange in the code. Didn't see that one. :P

Tnx