Pixels Alpha Value?

Blitz3D Forums/Blitz3D Programming/Pixels Alpha Value?

CyBeRGoth(Posted 2003) [#1]
How can you determine the alpha of a pixel using readpixel or readpixel fast?

I have code to extract the RGB from a pixel value, but how about Alpha?

Function Red(argb)
    Return (argb Shr 16) And $ff
End Function

Function Green(argb)
    Return (argb Shr 8) And $ff
End Function

Function Blue(argb)
    Return argb And $ff
End Function



Who was John Galt?(Posted 2003) [#2]
John -
Just been looking into this - alpha is encoded in the next set of 8 bits (argb shr 24) and $ff. 0 is see thru, up to 255 solid.


CyBeRGoth(Posted 2003) [#3]
Thanks 0DFEx

Just saw your function in Jeroen's post, that works a treat :)