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>SetBgImage</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="SetBackgroundColor.html" title="SetBackgroundColor" /><link rel="next" href="SetBrowserCache.html" title="SetBrowserCache" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetBgImage</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetBackgroundColor.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetBrowserCache.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetBgImage"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetBgImage</span></h2><p>SetBgImage — Set a graphic file to be used in the graph background</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetBgImage(<em class="parameter"><code>$input_file</code></em>, [<span class="optional"><em class="parameter"><code>$mode</code></em></span>])</pre></div><div class="refsect1"><a id="idp1377805532"></a><h2>Description</h2><p><code class="function">SetBgImage</code> sets an image file to be used as the graphbackground. The image can be scaled or tiled to fit.</p></div><div class="refsect1"><a id="idp1377806580"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$input_file</code></em></span></dt><dd><p>Path to the file to be used. The file can be any type allowed by GD, whichusually includes JPEG, GIF, and PNG.</p></dd><dt><span class="term"><em class="replaceable"><code>$mode</code></em></span></dt><dd><p>Optional display mode for the background image: one of the strings'centeredtile', 'tile', or 'scale'. The default is 'centeredtile'.</p></dd></dl></div></div><div class="refsect1"><a id="idp1377809148"></a><h2>Notes</h2><p>If a background image has been set, background color (set with<a class="xref" href="SetBackgroundColor.html" title="SetBackgroundColor"><span class="refentrytitle">SetBackgroundColor</span></a>) is ignored.</p><p>Scale mode scales the supplied background image file to fit the image areaof the entire graph. Tile and centeredtile modes repeat the suppliedbackground image file as needed to fit the image area of the graph. Thedifference is that centeredtile offsets the start position within thebackground image by half its size, which works better for some images.</p><p>SetBgImage sets a background for the entire image area, while<a class="xref" href="SetPlotAreaBgImage.html" title="SetPlotAreaBgImage"><span class="refentrytitle">SetPlotAreaBgImage</span></a> sets a background forthe plot area (generally, the area between the axes).If both are used, the plot area background overlays that portionof the overall background.</p><p>If <code class="varname">$input_file</code> is <code class="literal">NULL</code>, no backgroundimage will be used.</p><p>If you are going to use a JPEG file for the image background, you should beusing a truecolor PHPlot image. Truecolor images do not have alimited-size color map like palette images (which PHPlot uses by default).If you use palette image with a JPEG background, the background willlikely overflow your image's color map and leave no free color slots for PHPlotto use for plot elements. The same is true if using a 24-bit color(non-mapped) PNG file for a background if it has many colors.For more on truecolor PHPlot images, see <a class="xref" href="adv-truecolor.html" title="4.3. Truecolor Images">Section 4.3, “Truecolor Images”</a>.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetBackgroundColor.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="SetBrowserCache.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetBackgroundColor </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetBrowserCache</td></tr></table></div></body></html>