image.setDrawingAlpha()

Sets the current drawing alpha for images. All subsequent graphics operations use the specified alpha.

image.setDrawingAlpha( alpha=number )

Returns: Image

Argument Description
alpha
number, required

a floating point number in range 0-1

Examples

img=imageNew("", 250, 250, "RGB", "a29bfe");
<span class="nf">img.setDrawingAlpha</span><span class="p">(</span><span class="m">0</span><span class="p">.</span><span class="m">3</span><span class="p">);</span>
<span class="nf">img.drawRect</span><span class="p">(</span><span class="m">50</span><span class="p">,</span> <span class="m">50</span><span class="p">,</span> <span class="m">50</span><span class="p">,</span> <span class="m">50</span><span class="p">);</span>
<span class="nf">img.setDrawingAlpha</span><span class="p">(</span><span class="m">0</span><span class="p">.</span><span class="m">6</span><span class="p">);</span>
<span class="nf">img.drawRect</span><span class="p">(</span><span class="m">75</span><span class="p">,</span> <span class="m">75</span><span class="p">,</span> <span class="m">75</span><span class="p">,</span> <span class="m">75</span><span class="p">);</span>
<span class="nf">img.setDrawingAlpha</span><span class="p">(</span><span class="m">1</span><span class="p">);</span>
<span class="nf">img.drawRect</span><span class="p">(</span><span class="m">100</span><span class="p">,</span> <span class="m">100</span><span class="p">,</span> <span class="m">100</span><span class="p">,</span> <span class="m">100</span><span class="p">);</span>
<span class="nf">writeOutput</span><span class="p">(</span><span class="nv">img</span><span class="p">);</span>

See also