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>PrintImageFrame</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="PrintImage.html" title="PrintImage" /><link rel="next" href="RemoveCallback.html" title="RemoveCallback" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">PrintImageFrame</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="PrintImage.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="Re
moveCallback.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="PrintImageFrame"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">PrintImageFrame</span></h2><p>PrintImageFrame — Output the generated plot as one frame in a plot stream</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->PrintImageFrame()</pre></div><div class="refsect1"><a id="idp1377778220"></a><h2>Description</h2><p>
<code class="function">PrintImageFrame</code> is used to output (that is, send to
the browser) a single plot in a plot stream.
This function is similar to <a class="xref" href="PrintImage.html" title="PrintImage"><span class="refentrytitle">PrintImage</span></a>, except that the
image is preceded by MIME headers that indicate it is part of a stream.
Also, after producing the plot, <code class="function">PrintImageFrame()</code> changes
the PHPlot object so that a new plot can be drawn using the same object.
</p></div><div class="refsect1"><a id="idp1377780180"></a><h2>Parameters</h2><p>
None
</p></div><div class="refsect1"><a id="idp1377780788"></a><h2>Notes</h2><p>
The three functions <a class="xref" href="StartStream.html" title="StartStream"><span class="refentrytitle">StartStream</span></a>,
<code class="function">PrintImageFrame</code>, and <a class="xref" href="EndStream.html" title="EndStream"><span class="refentrytitle">EndStream</span></a>
are used together to produce streaming plots.
Scripts producing streaming plots must use a web server.
The PHP CLI will not work, because streaming plots require HTTP headers.
</p><p>
<code class="function">PrintImageFrame</code> resets internal flags in the PHPlot
object that will result in the next plot starting with a blank background,
just like the initial plot in the series. It does not change any of the
plot settings.
</p><p>
For more on streaming plots, see <a class="xref" href="adv-streaming.html" title="4.9. Streaming Plots">Section 4.9, “Streaming Plots”</a>.
</p></div><div class="refsect1"><a id="idp1377783972"></a><h2>Example</h2><p>
This is a partial example showing how the 3 functions are used to produce
streaming plots. See <a class="xref" href="adv-streaming.html#adv-streaming-example" title="4.9.3. Streaming Plots - Example">Section 4.9.3, “Streaming Plots - Example”</a> for the
complete example.
</p><pre class="programlisting">$plot = new PHPlot(640, 480);
...
$plot->SetPrintImage(False);
$plot->StartStream();
$timestamp = microtime(TRUE);
for ($frame = 0; $frame < $n_frames; $frame++) {
array_shift($data);
$data[] = next_row();
$plot->SetDataValues($data);
$plot->DrawGraph();
$plot->PrintImageFrame();
time_sleep_until($timestamp += $frame_time);
}
$plot->EndStream();</pre><p>
</p></div><div class="refsect1"><a id="idp1377785340"></a><h2>History</h2><p>
This function was added in PHPlot-5.8.0.
Prior releases are not able to produce streaming plots.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="PrintImage.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="RemoveCallback.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">PrintImage </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> RemoveCallback</td></tr></table></div></body></html>