ARGB integer value?

Blitz3D Forums/Blitz3D Programming/ARGB integer value?

ChrML(Posted 2003) [#1]
Any ideas on how to convert ordinary alpha, red, green and blue values to an ARGB integer, and vice versa? Doesn't seem like the docs says anything about it.


GfK(Posted 2003) [#2]
http://www.blitzbasic.com/codearcs/codearcs.php?code=551


ChrML(Posted 2003) [#3]
Thanks :)!


Who was John Galt?(Posted 2003) [#4]

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.....