Subversion Repositories cheapmusic

Rev

Blame | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>SetTransparentColor</title><link rel="stylesheet" type="text/css" href="phplotdoc.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="PHPlot Reference Manual" /><link rel="up" href="reference.html" title="PHPlot Function Reference" /><link rel="prev" href="SetTitleColor.html" title="SetTitleColor" /><link rel="next" href="SetTTFPath.html" title="SetTTFPath" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetTransparentColor</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetTitleColor.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetTTFPath.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetTransparentColor"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetTransparentColor</span></h2><p>SetTransparentColor &#8212; Designate one color to be transparent</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot-&gt;SetTransparentColor([<span class="optional"><em class="parameter"><code>$color</code></em></span>])</pre></div><div class="refsect1"><a id="idp1378816932"></a><h2>Description</h2><p>
<code class="function">SetTransparentColor</code> designates one color in the image
to be transparent. The designated color will not be visible (assuming the
image is viewed with a program which supports transparency) - instead,
everything drawn in that color will be transparent.
By default, no color is transparent.
    </p></div><div class="refsect1"><a id="idp1378818156"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$color</code></em></span></dt><dd><p>
Color value to designate as transparent.
See <a class="xref" href="conc-colors.html" title="3.5. Colors">Section 3.5, &#8220;Colors&#8221;</a> for more on color values.
If this parameter is omitted or NULL, the default behavior of not having a
transparent color is restored.
          </p></dd></dl></div></div><div class="refsect1"><a id="idp1378820140"></a><h2>Notes</h2><p>
This will only work if both the selected image file format
(see <a class="xref" href="SetFileFormat.html" title="SetFileFormat"><span class="refentrytitle">SetFileFormat</span></a>)
and the user's browser or viewer support transparency.
GIF format supports transparency.
PNG format also supports transparency, but viewer support is more limited.
    </p><p>
As an alternative to designating a single color as transparent, you can
control the transparency, or alpha value, of any color.
See <a class="xref" href="adv-truecolor.html" title="4.3. Truecolor Images">Section 4.3, &#8220;Truecolor Images&#8221;</a> for more information.
    </p><p>
An image either has a transparent color or it does not. (This is aside from
use of alpha values for colors.) If you designate 'yellow' as transparent,
for example, everything drawn on the image in yellow becomes transparent,
regardless of when it was drawn - before or after the transparent color
selection. This is because the transparent color designation occurs in the
image's color map - it does not change the pixels in the image.
    </p></div><div class="refsect1"><a id="idp1378822668"></a><h2>Example</h2><p>
To set the plot image background to be transparent, pick a color (here
'yellow') that won't be used anywhere else on the image, and use code
like this:
      </p><pre class="programlisting">$plot-&gt;SetBackgroundColor('yellow');
$plot-&gt;SetTransparentColor('yellow');
</pre><p>
    </p></div><div class="refsect1"><a id="idp1378823860"></a><h2>History</h2><p>
The ability to specify NULL or omit the parameter to disable having a
transparent color was added in PHPlot-6.0.0.
    </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetTitleColor.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="SetTTFPath.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetTitleColor </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetTTFPath</td></tr></table></div></body></html>