98 |
- |
1 |
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
|
|
|
2 |
<!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 — Designate one color to be transparent</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->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>
|
|
|
3 |
<code class="function">SetTransparentColor</code> designates one color in the image
|
|
|
4 |
to be transparent. The designated color will not be visible (assuming the
|
|
|
5 |
image is viewed with a program which supports transparency) - instead,
|
|
|
6 |
everything drawn in that color will be transparent.
|
|
|
7 |
By default, no color is transparent.
|
|
|
8 |
</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>
|
|
|
9 |
Color value to designate as transparent.
|
|
|
10 |
See <a class="xref" href="conc-colors.html" title="3.5. Colors">Section 3.5, “Colors”</a> for more on color values.
|
|
|
11 |
If this parameter is omitted or NULL, the default behavior of not having a
|
|
|
12 |
transparent color is restored.
|
|
|
13 |
</p></dd></dl></div></div><div class="refsect1"><a id="idp1378820140"></a><h2>Notes</h2><p>
|
|
|
14 |
This will only work if both the selected image file format
|
|
|
15 |
(see <a class="xref" href="SetFileFormat.html" title="SetFileFormat"><span class="refentrytitle">SetFileFormat</span></a>)
|
|
|
16 |
and the user's browser or viewer support transparency.
|
|
|
17 |
GIF format supports transparency.
|
|
|
18 |
PNG format also supports transparency, but viewer support is more limited.
|
|
|
19 |
</p><p>
|
|
|
20 |
As an alternative to designating a single color as transparent, you can
|
|
|
21 |
control the transparency, or alpha value, of any color.
|
|
|
22 |
See <a class="xref" href="adv-truecolor.html" title="4.3. Truecolor Images">Section 4.3, “Truecolor Images”</a> for more information.
|
|
|
23 |
</p><p>
|
|
|
24 |
An image either has a transparent color or it does not. (This is aside from
|
|
|
25 |
use of alpha values for colors.) If you designate 'yellow' as transparent,
|
|
|
26 |
for example, everything drawn on the image in yellow becomes transparent,
|
|
|
27 |
regardless of when it was drawn - before or after the transparent color
|
|
|
28 |
selection. This is because the transparent color designation occurs in the
|
|
|
29 |
image's color map - it does not change the pixels in the image.
|
|
|
30 |
</p></div><div class="refsect1"><a id="idp1378822668"></a><h2>Example</h2><p>
|
|
|
31 |
To set the plot image background to be transparent, pick a color (here
|
|
|
32 |
'yellow') that won't be used anywhere else on the image, and use code
|
|
|
33 |
like this:
|
|
|
34 |
</p><pre class="programlisting">$plot->SetBackgroundColor('yellow');
|
|
|
35 |
$plot->SetTransparentColor('yellow');
|
|
|
36 |
</pre><p>
|
|
|
37 |
</p></div><div class="refsect1"><a id="idp1378823860"></a><h2>History</h2><p>
|
|
|
38 |
The ability to specify NULL or omit the parameter to disable having a
|
|
|
39 |
transparent color was added in PHPlot-6.0.0.
|
|
|
40 |
</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>
|