| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="45ChoosingtheimageformatforJpGraph.html">
|
|
|
8 |
<LINK REL="Next" HREF="47WorkingwithfontsinJpGraph.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="45ChoosingtheimageformatforJpGraph.html">Previous</A>
|
|
|
26 |
<A HREF="47WorkingwithfontsinJpGraph.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H2><A NAME="4_6">4.6 Alternatives to streaming back the image</A></H2>
|
|
|
29 |
<P> If you like to save the image directly to a file instead of
|
|
|
30 |
streaming it back to the browser then you just have to specify an
|
|
|
31 |
absolute filename in the final call to Graph::Stroke(), i.e.</P>
|
|
|
32 |
<P><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
33 |
$graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
34 |
Stroke</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
35 |
"/usr/home/peter/images/result2002.png"</FONT><FONT color="#007700">);</FONT><FONT
|
|
|
36 |
color="#0000BB"></FONT></FONT></CODE></DIV></P>
|
|
|
37 |
<P></P>
|
|
|
38 |
<P> Please note that the user running as Apache/PHP must have write
|
|
|
39 |
access to the specified directory.</P>
|
|
|
40 |
<P> There are also two predefined filenames which have special meaning.</P>
|
|
|
41 |
<UL>
|
|
|
42 |
<LI>"auto", This will create a file in the same directory as the script
|
|
|
43 |
with the same name as the script but with the correct image extension.</LI>
|
|
|
44 |
<LI>_IMG_HANDLER, (This is defined in jpgraph.php). Specifying this
|
|
|
45 |
filename will not create a an image to file or stram it back to the
|
|
|
46 |
browser. Instead it will instruct the Stroke() method to just return
|
|
|
47 |
the handle for the GD image. This is useful if you later want to
|
|
|
48 |
manipulate the image in ways that are not yet supported by Jpgraph. For
|
|
|
49 |
example include the image in generated PDF files.
|
|
|
50 |
<BR><I> Example:</I><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT
|
|
|
51 |
color="#0000BB"> $handle </FONT><FONT color="#007700">= </FONT><FONT color="#0000BB">
|
|
|
52 |
$graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">Stroke</FONT><FONT
|
|
|
53 |
color="#007700">(</FONT><FONT color="#0000BB">_IMG_HANDLER</FONT><FONT color="#007700">
|
|
|
54 |
);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
55 |
<P></P>
|
|
|
56 |
</LI>
|
|
|
57 |
</UL>
|
|
|
58 |
<P></P>
|
|
|
59 |
<HR NOSHADE>
|
|
|
60 |
<A HREF="toc.html">Contents</A>
|
|
|
61 |
<A HREF="45ChoosingtheimageformatforJpGraph.html">Previous</A>
|
|
|
62 |
<A HREF="47WorkingwithfontsinJpGraph.html">Next</A>
|
|
|
63 |
</BODY>
|
|
|
64 |
</HTML>
|