Function read_alpha(x,y,texture_name)
argb=ReadPixel(x,y,textureBuffer(texture_name))
Return ARGB And $ff000000
End Function
Function write_argb(x,y,alpha,r,g,b,texture_name)
argb=(b Or (g Shl 8) Or (r Shl 16) Or (alpha Shl 24))
WritePixel x,y,argb,TextureBuffer(texture_name)
End Function
Copied from Dr Av's stuff with a couple of mods for reading /writing an alpha val of your choice (0 transparent-255 solid) to/from a texturebuffer. Untested but no doubt Cybergoth will fix it if it needs fixing.....
|