Try

open (FH, ">/www/html/images/graph.png") || die "Could not create
/www/html/images/graph.png: $!"; # Always check file opens
binmode FH; #  Set to binmode to prevent OS from mangling the data
print FH $gd_image->png();
close(FH);

HTH

John

-----Original Message-----
From: Conan Chai [mailto:[EMAIL PROTECTED]] 
Sent: 26 March 2002 12:07
To: [EMAIL PROTECTED]
Subject: output graph to file


Hi,

i want to ouput a graph image that i generated to a file but not quite sure
how to do it, below is what i have done.pls advise

Conan

......
......
......
use GD::Graph::bars;
my $graph = new GD::Graph::bars(800, 600);

my $gd_image = $graph->plot( \@data ); # @data contains x & y values for the
bar graph binmode FH;

open (FH, "> /www/html/images/graph.png");
print(FH "$gd_image->png");
close(FH);
......
......
.......


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to