Reading Image Buffers

BlitzPlus Forums/BlitzPlus Programming/Reading Image Buffers

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

heightmap=LoadImage("testh.bmp")

hBuffer = ImageBuffer(heightmap)
LockBuffer hBuffer

For y=1 To 255  ; probably want 0 to 255.
	For x=1 To 255
		a=ReadPixel(x,y,hBuffer)
		; do something with returned value
	Next
	; likewise...
Next

UnlockBuffer hBuffer