Blame | Letzte Änderung | Log anzeigen | RSS feed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1"><LINK REL="Start" HREF="index.html"><LINK REL="Contents" HREF="toc.html"><LINK REL="Prev" HREF="45ChoosingtheimageformatforJpGraph.html"><LINK REL="Next" HREF="47WorkingwithfontsinJpGraph.html"><STYLE TYPE="text/css"><!--BODY { font-family: serif }H1 { font-family: sans-serif }H2 { font-family: sans-serif }H3 { font-family: sans-serif }H4 { font-family: sans-serif }H5 { font-family: sans-serif }H6 { font-family: sans-serif }SUB { font-size: smaller }SUP { font-size: smaller }PRE { font-family: monospace }A { text-decoration: none }--></STYLE></HEAD><BODY><A HREF="toc.html">Contents</A><A HREF="45ChoosingtheimageformatforJpGraph.html">Previous</A><A HREF="47WorkingwithfontsinJpGraph.html">Next</A><HR NOSHADE><H2><A NAME="4_6">4.6 Alternatives to streaming back the image</A></H2><P> If you like to save the image directly to a file instead ofstreaming it back to the browser then you just have to specify anabsolute filename in the final call to Graph::Stroke(), i.e.</P><P><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> $graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">Stroke</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"/usr/home/peter/images/result2002.png"</FONT><FONT color="#007700">);</FONT><FONTcolor="#0000BB"></FONT></FONT></CODE></DIV></P><P></P><P> Please note that the user running as Apache/PHP must have writeaccess to the specified directory.</P><P> There are also two predefined filenames which have special meaning.</P><UL><LI>"auto", This will create a file in the same directory as the scriptwith the same name as the script but with the correct image extension.</LI><LI>_IMG_HANDLER, (This is defined in jpgraph.php). Specifying thisfilename will not create a an image to file or stram it back to thebrowser. Instead it will instruct the Stroke() method to just returnthe handle for the GD image. This is useful if you later want tomanipulate the image in ways that are not yet supported by Jpgraph. Forexample include the image in generated PDF files.<BR><I> Example:</I><DIV class="phpscript"><CODE><FONT color="#000000"> <FONTcolor="#0000BB"> $handle </FONT><FONT color="#007700">= </FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">Stroke</FONT><FONTcolor="#007700">(</FONT><FONT color="#0000BB">_IMG_HANDLER</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV><P></P></LI></UL><P></P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="45ChoosingtheimageformatforJpGraph.html">Previous</A><A HREF="47WorkingwithfontsinJpGraph.html">Next</A></BODY></HTML>