Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need basic operational GD module help 1

Status
Not open for further replies.

calabama

Programmer
Feb 19, 2001
180
US
Having trouble getting GD module to work. The version on my server is 1.18. I wanted do draw a graphic and store,print and/or use graphic later in another document.

Thanks for any help

Tim Briggs


 
Hi Tim,

What exactly are you having trouble with? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
From the Perl documentation

png

$image->png object method
This returns the image data in PNG format. You can then print it, pipe it to a display program, or write it to a file. Example:

$png_data = $myImage->png;
open (DISPLAY,"| display -") || die;
binmode DISPLAY;
print DISPLAY $png_data;
close DISPLAY;
Note the use of binmode(). This is crucial for portability to DOSish platforms.


So to write the image data to a file you could say:

$png_data = $myImage->png;
open(F,">file.png")
|| die "Can't create file.png\n$!\n";
print F $png_data;
close F;

Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top