pigeonjp has asked for the wisdom of the Perl Monks concerning the following question:

can someone please tell me how to install GD on activeperl for windows. i've installed it with the ppm and i've tried multiple examples of code and can't get anywhere. when in the ppm i've done a query to see if the gd is installed and it is indeed there. this is one of the pieces of code i've tried to use with no sucess!
use Chart::Plot; my $img = Chart::Plot->new; my @data = qw( 10 11 11 12 12 13 13 14 14 15); $img->setData (\@data); # draw circles around each data point, diameter 15 pixels my $gd = $img->getGDobject; my $blue = $gd->colorAllocate(0,0,255); # or use $img's blue my ($px,$py); for (my $i=0; $i<$#data; $i+=2) { ($px,$py) = $img->data2pxl ($data[$i], $data[$i+1]); $gd->arc($px,$py,15,15,0,360,$blue); } # draw the rest of the chart, and print it open (OUT,">plot.gif"); binmode OUT; print OUT $img->draw(); close OUT;
Edit kudra, 2001-06-29 Added code tags

Replies are listed 'Best First'.
Re: GD
by Albannach (Monsignor) on Jun 29, 2001 at 23:03 UTC
    It always helps if you tell us exactly what you mean by "no success", but the code you posted runs fine here. Chart::Plot must be installed separately as it does not come with GD, but then if that was your problem you would have received an error to that effect.

    You should also know that unless you have an older version of GD you will not be able to create GIF images, so your code will create a PNG image and save it with a .GIF extension.

    --
    I'd like to be able to assign to an luser

Re: GD
by petdance (Parson) on Jun 30, 2001 at 02:18 UTC
    We don't know HOW it doesn't work. Do you get an error message? Where do you fail? Can Perl not find Chart::Plot? Or maybe the pictures aren't being saved? Or maybe they don't look right? Maybe your machine catches fire? We can't tell.

    Take a look at How to get the most of your question from the monks for more along these lines.

    xoxo,
    Andy
    --
    I was dreaming when I wrote this, so sue me if I go too fast.

Re: GD
by MadraghRua (Vicar) on Jun 30, 2001 at 03:22 UTC
    Have you remembered to put the GD library on your computer and compiled it? The module needs this library to work, or at least it used to.

    MadraghRua
    yet another biologist hacking perl....