ImageSetDrawingAlpha()

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

Requires Extension: Image extension

ImageSetDrawingAlpha( image=any, alpha=number );

Returns: void

Argument Description
image
any, required

The image on which this operation is performed.

Alias: name

alpha
number, required

a floating point number in range 0-1

Examples

img=imageNew("", 250, 250, "RGB", "a29bfe");
<span class="nf">imagesetDrawingAlpha</span><span class="p">(</span><span class="nv">img</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">imagedrawRect</span><span class="p">(</span><span class="nv">img</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">imagesetDrawingAlpha</span><span class="p">(</span><span class="nv">img</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">imagedrawRect</span><span class="p">(</span><span class="nv">img</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">imagesetDrawingAlpha</span><span class="p">(</span><span class="nv">img</span> <span class="p">,</span><span class="m">1</span><span class="p">);</span>
<span class="nf">imagedrawRect</span><span class="p">(</span><span class="nv">img</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