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 _BLEND statement turns on 32 bit alpha blending for an image or screen mode and is on by default.

Syntax

_BLEND [imageHandle&]

Parameters

Description

Example(s)


SCREEN _NEWIMAGE(640, 480, 32)

'CLS , _RGB(128, 128, 128) 'change background color for other results

_DONTBLEND

bg& = POINT(0, 0)
PRINT _RED(bg&), _GREEN(bg&), _BLUE(bg&), _ALPHA(bg&)

LINE (100, 100)-(200, 200), _RGBA32(255, 128, 0, 128), BF

LINE (440, 100)-(540, 200), _RGBA32(0, 0, 255, 64), BF

K$ = INPUT$(1)

_BLEND

LINE (270, 300)-(370, 400), _RGBA32(255, 128, 0, 128), BF
m& = POINT(303, 302)
PRINT _RED(m&), _GREEN(m&), _BLUE(m&), _ALPHA(m&)
K$ = INPUT$(1)

LINE (270, 300)-(370, 400), _RGBA32(0, 0, 255, 64), BF
m& = POINT(303, 302)
PRINT _RED(m&), _GREEN(m&), _BLUE(m&), _ALPHA(m&)


_RGBA(255,128,0,128) onto _RGBA(0,0,255,64)

results in

_RGBA(95,48,64,128)

See Also