Hi
I understand that we have to use pixmap = lockimage(image) and unlockimage(image) to change the pixels in an image, but I was wondering why?
This should work, but doesn't and was wondering why we can't change values in memory using poke or writepixel if we haven't locked the image first.
an example (doesn't do anything though)
while (in theory) this does work
Having a look through max2d.bmx etc I notice that its not doing much when locking an image just passing back a pointer to the i.pixmaps[frame]
I'm very confused at unlocking an image as the code doesn't seem to do much!??!!? Theres nothing in the function...
I understand that we have to use pixmap = lockimage(image) and unlockimage(image) to change the pixels in an image, but I was wondering why?
This should work, but doesn't and was wondering why we can't change values in memory using poke or writepixel if we haven't locked the image first.
an example (doesn't do anything though)
i:timage = createimage(100,100) writepixel i.pixmaps[0],0,0,$ffffffff
while (in theory) this does work
i:timage = createimage(100,100) p:tpixmap = lockimage(i) writepixel p,0,0,$ffffffff unlockimage i
Having a look through max2d.bmx etc I notice that its not doing much when locking an image just passing back a pointer to the i.pixmaps[frame]
I'm very confused at unlocking an image as the code doesn't seem to do much!??!!? Theres nothing in the function...
Rem bbdoc: Unlock an image about: Unlocks an image previously locked with #LockImage. end rem Function UnlockImage( image:TImage,frame=0 ) End Function