1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-03 08:51:22 +00:00
qb64/internal/help/_BLEND.txt

142 lines
4.8 KiB
Plaintext
Raw Normal View History

2016-03-18 11:36:04 +00:00
{{DISPLAYTITLE:_BLEND}}
2017-10-10 14:55:21 +00:00
The [[_BLEND]] statement turns on 32 bit alpha blending for an image or screen mode and is on by default.
{{PageSyntax}}
2017-10-10 14:55:21 +00:00
: [[_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.
2017-10-10 14:55:21 +00:00
* 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.'''
2017-10-10 14:55:21 +00:00
{{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}}
<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
style='border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;
mso-yfti-tbllook:480;mso-padding-alt:0cm 5.4pt 0cm 5.4pt;mso-border-insideh:
2019-04-15 01:15:33 +00:00
.5pt solid windowtext;mso-border-insidev:.5pt solid windowtext'>
2019-04-15 01:15:33 +00:00
<tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes'>
<td width=118 valign=top style='width:88.55pt;border:solid windowtext 1.0pt;
2019-04-15 01:15:33 +00:00
mso-border-alt:solid windowtext .5pt;background:#FF8000;padding:0cm 5.4pt 0cm 5.4pt'>
2019-04-15 01:15:33 +00:00
<p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New";
2019-04-15 01:15:33 +00:00
mso-fareast-font-family:"Times New Roman"'> </span></p>
2019-04-15 01:15:33 +00:00
</td>
<td width=181 valign=top style='width:136.05pt;border:solid windowtext 1.0pt;
border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:
2019-04-15 01:15:33 +00:00
solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
2019-04-15 01:15:33 +00:00
<p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New";
2019-04-15 01:15:33 +00:00
mso-fareast-font-family:"Times New Roman"'>_RGBA(255,128,0,128)</span></p>
2019-04-15 01:15:33 +00:00
<p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New";
2019-04-15 01:15:33 +00:00
mso-fareast-font-family:"Times New Roman"'>   onto</span></p>
2019-04-15 01:15:33 +00:00
<p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New";
2019-04-15 01:15:33 +00:00
mso-fareast-font-family:"Times New Roman"'>     _RGBA(0,0,255,64)</span></p>
2019-04-15 01:15:33 +00:00
</td>
<td width=120 valign=top style='width:90.0pt;border:solid windowtext 1.0pt;
border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:
2019-04-15 01:15:33 +00:00
solid windowtext .5pt;background:blue;padding:0cm 5.4pt 0cm 5.4pt'>
2019-04-15 01:15:33 +00:00
<p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New";
2019-04-15 01:15:33 +00:00
mso-fareast-font-family:"Times New Roman"'> </span></p>
2019-04-15 01:15:33 +00:00
</td>
<td width=180 valign=top style='width:135.0pt;border:solid windowtext 1.0pt;
border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:
2019-04-15 01:15:33 +00:00
solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
2019-04-15 01:15:33 +00:00
<p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New";
2019-04-15 01:15:33 +00:00
mso-fareast-font-family:"Times New Roman"'>results in</span></p>
2019-04-15 01:15:33 +00:00
<p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New";
2019-04-15 01:15:33 +00:00
mso-fareast-font-family:"Times New Roman"'>  _RGBA(95,48,64,128)</span></p>
2019-04-15 01:15:33 +00:00
</td>
<td width=120 valign=top style='width:90.0pt;border:solid windowtext 1.0pt;
border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:
2019-04-15 01:15:33 +00:00
solid windowtext .5pt;background:#603080;padding:0cm 5.4pt 0cm 5.4pt'>
2019-04-15 01:15:33 +00:00
<p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New";
2019-04-15 01:15:33 +00:00
mso-fareast-font-family:"Times New Roman"'> </span></p>
2019-04-15 01:15:33 +00:00
</td>
2019-04-15 01:15:33 +00:00
</tr>
2019-04-15 01:15:33 +00:00
</table>
{{PageSeeAlso}}
2017-10-10 14:55:21 +00:00
* [[_DONTBLEND]], [[_BLEND (function)]]
* [[Images]]
2019-04-15 01:15:33 +00:00
{{PageNavigation}}