Lhamo_rin has asked for the wisdom of the Perl Monks concerning the following question:
I have installed GD and GD::Graph along with the required zlib and libpng. When running a simple script I get the following error:
Can't locate object method "png" via package "GD:;Image" at ./gd_test2.pl line 33.
Can someone explain why I might get this message?
use GD; # create a new image $im = new GD::Image(100,100); # allocate some colors $white = $im->colorAllocate(255,255,255); $black = $im->colorAllocate(0,0,0); $red = $im->colorAllocate(255,0,0); $blue = $im->colorAllocate(0,0,255); # make the background transparent and interlaced $im->transparent($white); $im->interlaced('true'); # Put a black frame around the picture $im->rectangle(0,0,99,99,$black); # Draw a blue oval $im->arc(50,50,95,75,0,360,$blue); # And fill it with red $im->fill(50,50,$red); # make sure we are writing to a binary stream binmode STDOUT; # Convert the image to PNG and print it on standard output print $im->png;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GDGraph Installation
by Tanktalus (Canon) on Aug 30, 2005 at 17:46 UTC | |
|
Re: GDGraph Installation
by Fang (Pilgrim) on Aug 30, 2005 at 17:48 UTC | |
|
Re: GDGraph Installation
by johnnywang (Priest) on Aug 30, 2005 at 18:01 UTC |