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>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="RemoveCallback.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>
|
|
|
3 |
<code class="function">PrintImageFrame</code> is used to output (that is, send to
|
|
|
4 |
the browser) a single plot in a plot stream.
|
|
|
5 |
This function is similar to <a class="xref" href="PrintImage.html" title="PrintImage"><span class="refentrytitle">PrintImage</span></a>, except that the
|
|
|
6 |
image is preceded by MIME headers that indicate it is part of a stream.
|
|
|
7 |
Also, after producing the plot, <code class="function">PrintImageFrame()</code> changes
|
|
|
8 |
the PHPlot object so that a new plot can be drawn using the same object.
|
|
|
9 |
</p></div><div class="refsect1"><a id="idp1377780180"></a><h2>Parameters</h2><p>
|
|
|
10 |
None
|
|
|
11 |
</p></div><div class="refsect1"><a id="idp1377780788"></a><h2>Notes</h2><p>
|
|
|
12 |
The three functions <a class="xref" href="StartStream.html" title="StartStream"><span class="refentrytitle">StartStream</span></a>,
|
|
|
13 |
<code class="function">PrintImageFrame</code>, and <a class="xref" href="EndStream.html" title="EndStream"><span class="refentrytitle">EndStream</span></a>
|
|
|
14 |
are used together to produce streaming plots.
|
|
|
15 |
Scripts producing streaming plots must use a web server.
|
|
|
16 |
The PHP CLI will not work, because streaming plots require HTTP headers.
|
|
|
17 |
</p><p>
|
|
|
18 |
<code class="function">PrintImageFrame</code> resets internal flags in the PHPlot
|
|
|
19 |
object that will result in the next plot starting with a blank background,
|
|
|
20 |
just like the initial plot in the series. It does not change any of the
|
|
|
21 |
plot settings.
|
|
|
22 |
</p><p>
|
|
|
23 |
For more on streaming plots, see <a class="xref" href="adv-streaming.html" title="4.9. Streaming Plots">Section 4.9, “Streaming Plots”</a>.
|
|
|
24 |
</p></div><div class="refsect1"><a id="idp1377783972"></a><h2>Example</h2><p>
|
|
|
25 |
This is a partial example showing how the 3 functions are used to produce
|
|
|
26 |
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
|
|
|
27 |
complete example.
|
|
|
28 |
</p><pre class="programlisting">$plot = new PHPlot(640, 480);
|
|
|
29 |
...
|
|
|
30 |
$plot->SetPrintImage(False);
|
|
|
31 |
$plot->StartStream();
|
|
|
32 |
$timestamp = microtime(TRUE);
|
|
|
33 |
for ($frame = 0; $frame < $n_frames; $frame++) {
|
|
|
34 |
array_shift($data);
|
|
|
35 |
$data[] = next_row();
|
|
|
36 |
$plot->SetDataValues($data);
|
|
|
37 |
$plot->DrawGraph();
|
|
|
38 |
$plot->PrintImageFrame();
|
|
|
39 |
time_sleep_until($timestamp += $frame_time);
|
|
|
40 |
}
|
|
|
41 |
$plot->EndStream();</pre><p>
|
|
|
42 |
</p></div><div class="refsect1"><a id="idp1377785340"></a><h2>History</h2><p>
|
|
|
43 |
This function was added in PHPlot-5.8.0.
|
|
|
44 |
Prior releases are not able to produce streaming plots.
|
|
|
45 |
</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>
|