ReadPixelFast pb
BlitzPlus Forums/BlitzPlus Programming/ReadPixelFast pb| 
 | ||
| WritePixelFast seems to work but if I use ReadPixelFast instead of ReadPixel my sprite is purple block! Why? 
Graphics(800,600,0,2)
SetBuffer BackBuffer()
img=LoadImage("sprite200x180.jpg")
img_buf=ImageBuffer(img)
While Not KeyHit(1)
	x=MouseX()
	y=MouseY()
	Cls
	LockBuffer()
	For j=0 To 179
		For i=0 To 199
			c=ReadPixel(i,j,img_buf)
			WritePixelFast(x+i,y+j,c)	
		Next
	Next
	UnlockBuffer()
	Flip()
Wend
FreeImage(img)
 | 
| 
 | ||
| Oooppss, I know why. I forgot to lock also the image buffer :)Now it works fast | 
| 
 | ||
| i dunno if u a german . but for all german`s here ALL SINGING : Mein Gott Walter ..... | 
| 
 | ||
| Mein Gott Walter. Da hat der Panno dich Panne gemacht. :) |