mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-18 23:14:50 +00:00
60 lines
1.9 KiB
Text
60 lines
1.9 KiB
Text
|
{{QBDLDATE:05-20-2022}}
|
||
|
{{QBDLTIME:23:06:40}}
|
||
|
{{DISPLAYTITLE:_BLEND}}
|
||
|
The [[_BLEND]] statement turns on 32 bit alpha blending for an image or screen mode and is on by default.
|
||
|
|
||
|
|
||
|
{{PageSyntax}}
|
||
|
: [[_BLEND]] [{{Parameter|imageHandle&}}]
|
||
|
|
||
|
===Parameters===
|
||
|
* {{Parameter|imageHandle&}} refers to an image in memory. If not specified, the current destination page (See [[_DEST]]) is affected.
|
||
|
|
||
|
|
||
|
{{PageDescription}}
|
||
|
* Alpha blending is on by default when loading a .PNG image to a 32-bit surface.
|
||
|
* Normally it is used to turn blending on after a previous [[_DONTBLEND]] call.
|
||
|
* [[_BLEND]] can only be used on 32-bit surfaces, otherwise it will produce the error [[ERROR Codes|Illegal Function Call]].
|
||
|
* '''Note: [[_DONTBLEND]] is faster than the default [[_BLEND]] unless you really need to use it in 32 bit.'''
|
||
|
* '''32 bit screen surface backgrounds (black) have zero [[_ALPHA]] so that they are transparent when placed over other surfaces.'''
|
||
|
|
||
|
|
||
|
{{PageExamples}}
|
||
|
''Example:''
|
||
|
{{CodeStart}}
|
||
|
{{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32)
|
||
|
|
||
|
'{{Cl|CLS}} , {{Cl|_RGB}}(128, 128, 128) 'change background color for other results
|
||
|
|
||
|
{{Cl|_DONTBLEND}}
|
||
|
|
||
|
bg& = {{Cl|POINT}}(0, 0)
|
||
|
{{Cl|PRINT}} {{Cl|_RED}}(bg&), {{Cl|_GREEN}}(bg&), {{Cl|_BLUE}}(bg&), {{Cl|_ALPHA}}(bg&)
|
||
|
|
||
|
{{Cl|LINE}} (100, 100)-(200, 200), {{Cl|_RGBA32}}(255, 128, 0, 128), BF
|
||
|
|
||
|
{{Cl|LINE}} (440, 100)-(540, 200), {{Cl|_RGBA32}}(0, 0, 255, 64), BF
|
||
|
|
||
|
K$ = {{Cl|INPUT$}}(1)
|
||
|
|
||
|
{{Cl|_BLEND}}
|
||
|
|
||
|
{{Cl|LINE}} (270, 300)-(370, 400), {{Cl|_RGBA32}}(255, 128, 0, 128), BF
|
||
|
m& = {{Cl|POINT}}(303, 302)
|
||
|
{{Cl|PRINT}} {{Cl|_RED}}(m&), {{Cl|_GREEN}}(m&), {{Cl|_BLUE}}(m&), {{Cl|_ALPHA}}(m&)
|
||
|
K$ = {{Cl|INPUT$}}(1)
|
||
|
|
||
|
{{Cl|LINE}} (270, 300)-(370, 400), {{Cl|_RGBA32}}(0, 0, 255, 64), BF
|
||
|
m& = {{Cl|POINT}}(303, 302)
|
||
|
{{Cl|PRINT}} {{Cl|_RED}}(m&), {{Cl|_GREEN}}(m&), {{Cl|_BLUE}}(m&), {{Cl|_ALPHA}}(m&)
|
||
|
{{CodeEnd}}
|
||
|
|
||
|
|
||
|
{{PageSeeAlso}}
|
||
|
* [[_DONTBLEND]], [[_BLEND (function)]]
|
||
|
* [[Images]]
|
||
|
|
||
|
|
||
|
{{PageNavigation}}
|
||
|
|