Writepixel command

Blitz3D Forums/Blitz3D Programming/Writepixel command

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.

Maybe the "index" dimanesion isn't required. Probably he meant something like this:

sw=graphicswidth()
sh=graphicsheight()
setbuffer backbuffer()

dim arr(sw-1,sh-1)
lockbuffer()
for j=0 to sh-1
for i=0 to sw-1
argb=readpixelfast(i,j)  ;read pixel
arr(i,j)=argb    ; store in array
argb2= (argb and FEFEFE) shr 1  ;  some fx: darken
writepixelfast i,j,argb2
; or, of course:
writepixelfast i,j,arr(i,j)  ; accessing array by pixel coords
next
next
unlockbuffer()

(just typed)