I want to be able to control all aspects of memblocks
so I'm trying to write in every byte to a memblock to then make an image from it
but I'm having a prob
adding this code works
SetMemblockInt(1,t,makecolor(0,255,0))
adding this one, not working
red
SetMemblockByte(1,t,0)
green
SetMemblockByte(1,t+1,255)
blue
SetMemblockByte(1,t+2,0)
Alpha
SetMemblockByte(1,t+3,0)
******** not working code
width=getdevicewidth()
height=getdeviceheight()
setvirtualresolution(width,height)
creatememblock(1,12+(width*height*4))
setmemblockint(1,0,width)
setmemblockint(1,4,height)
setmemblockint(1,8,32)
for t=12 to (width*height*4) step 4
setmemblockbyte(1,t,200)
setmemblockbyte(1,t+1,0)
setmemblockbyte(1,t+2,0)
setmemblockbyte(1,t+3,0)
next t
createimagefrommemblock(1,1)
deletememblock(1)
createsprite(1,1)
do
sync()
loop
************not working code
************working code
width=getdevicewidth()
height=getdeviceheight()
setvirtualresolution(width,height)
creatememblock(1,12+(width*height*4))
setmemblockint(1,0,width)
setmemblockint(1,4,height)
setmemblockint(1,8,32)
for t=12 to (width*height*4) step 4
setmemblockint(1,t,makecolor(0,255,0))
next t
createimagefrommemblock(1,1)
deletememblock(1)
createsprite(1,1)
do
sync()
loop
***********working code