QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The _ALPHA32 function returns the alpha transparency level of a 32 bit color value.

Syntax

alpha& = _ALPHA32(color32~&)**

Parameter(s)

Description

Example(s)

Finding the alpha transparency level in a 32 bit screen using an _RGBA _UNSIGNED LONG color value.


SCREEN _NEWIMAGE(640, 480, 32)

clr~& = _RGBA(255, 0, 255, 192)
PRINT "Color:"; clr~&

COLOR clr~&
PRINT "Alpha32:"; _ALPHA32(clr~&)

END 


Color: 3237937407
Alpha32: 192

Notes: The color value is equivalent to &H &HC0FF00FF where &HC0 equals 192. _RGB alphas are always &HFF(255).

See Also