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.
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.
$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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.