BLEND: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
(Created page with "{{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...") |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
: [[_BLEND]] [{{Parameter|imageHandle&}}] | : [[_BLEND]] [{{Parameter|imageHandle&}}] | ||
{{PageParameters}} | |||
* {{Parameter|imageHandle&}} refers to an image in memory. If not specified, the current destination page (See [[_DEST]]) is affected. | * {{Parameter|imageHandle&}} refers to an image in memory. If not specified, the current destination page (See [[_DEST]]) is affected. | ||
Line 21: | Line 22: | ||
''Example:'' | ''Example:'' | ||
{{CodeStart}} | {{CodeStart}} | ||
{{Cl | {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}({{Text|640|#F580B1}}, {{Text|480|#F580B1}}, {{Text|32|#F580B1}}) | ||
{{Text|<nowiki>'CLS , _RGB(128, 128, 128) 'change background color for other results</nowiki>|#919191}} | |||
{{Cl|_DONTBLEND}} | {{Cl|_DONTBLEND}} | ||
bg& = {{Cl|POINT}}(0, 0) | bg& = {{Cl|POINT}}({{Text|0|#F580B1}}, {{Text|0|#F580B1}}) | ||
{{Cl|PRINT}} {{Cl|_RED}}(bg&), {{Cl|_GREEN}}(bg&), {{Cl|_BLUE}}(bg&), {{Cl|_ALPHA}}(bg&) | {{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}} ({{Text|100|#F580B1}}, {{Text|100|#F580B1}})-({{Text|200|#F580B1}}, {{Text|200|#F580B1}}), {{Cl|_RGBA32}}({{Text|255|#F580B1}}, {{Text|128|#F580B1}}, {{Text|0|#F580B1}}, {{Text|128|#F580B1}}), BF | ||
{{Cl|LINE}} (440, 100)-(540, 200), {{Cl|_RGBA32}}(0, 0, 255, 64), BF | {{Cl|LINE}} ({{Text|440|#F580B1}}, {{Text|100|#F580B1}})-({{Text|540|#F580B1}}, {{Text|200|#F580B1}}), {{Cl|_RGBA32}}({{Text|0|#F580B1}}, {{Text|0|#F580B1}}, {{Text|255|#F580B1}}, {{Text|64|#F580B1}}), BF | ||
K$ = {{Cl|INPUT$}}(1) | K$ = {{Cl|INPUT$}}({{Text|1|#F580B1}}) | ||
{{Cl|_BLEND}} | {{Cl|_BLEND}} | ||
{{Cl|LINE}} (270, 300)-(370, 400), {{Cl|_RGBA32}}(255, 128, 0, 128), BF | {{Cl|LINE}} ({{Text|270|#F580B1}}, {{Text|300|#F580B1}})-({{Text|370|#F580B1}}, {{Text|400|#F580B1}}), {{Cl|_RGBA32}}({{Text|255|#F580B1}}, {{Text|128|#F580B1}}, {{Text|0|#F580B1}}, {{Text|128|#F580B1}}), BF | ||
m& = {{Cl|POINT}}(303, 302) | m& = {{Cl|POINT}}({{Text|303|#F580B1}}, {{Text|302|#F580B1}}) | ||
{{Cl|PRINT}} {{Cl|_RED}}(m&), {{Cl|_GREEN}}(m&), {{Cl|_BLUE}}(m&), {{Cl|_ALPHA}}(m&) | {{Cl|PRINT}} {{Cl|_RED}}(m&), {{Cl|_GREEN}}(m&), {{Cl|_BLUE}}(m&), {{Cl|_ALPHA}}(m&) | ||
K$ = {{Cl|INPUT$}}(1) | K$ = {{Cl|INPUT$}}({{Text|1|#F580B1}}) | ||
{{Cl|LINE}} (270, 300)-(370, 400), {{Cl|_RGBA32}}(0, 0, 255, 64), BF | {{Cl|LINE}} ({{Text|270|#F580B1}}, {{Text|300|#F580B1}})-({{Text|370|#F580B1}}, {{Text|400|#F580B1}}), {{Cl|_RGBA32}}({{Text|0|#F580B1}}, {{Text|0|#F580B1}}, {{Text|255|#F580B1}}, {{Text|64|#F580B1}}), BF | ||
m& = {{Cl|POINT}}(303, 302) | m& = {{Cl|POINT}}({{Text|303|#F580B1}}, {{Text|302|#F580B1}}) | ||
{{Cl|PRINT}} {{Cl|_RED}}(m&), {{Cl|_GREEN}}(m&), {{Cl|_BLUE}}(m&), {{Cl|_ALPHA}}(m&) | {{Cl|PRINT}} {{Cl|_RED}}(m&), {{Cl|_GREEN}}(m&), {{Cl|_BLUE}}(m&), {{Cl|_ALPHA}}(m&) | ||
{{CodeEnd}} | {{CodeEnd}} | ||
Latest revision as of 11:01, 20 March 2023
The _BLEND statement turns on 32 bit alpha blending for an image or screen mode and is on by default.
Syntax
- _BLEND [imageHandle&]
Parameters
- imageHandle& refers to an image in memory. If not specified, the current destination page (See _DEST) is affected.
Description
- 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 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.
Examples
Example:
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&) |
See also