|
Posted by smallpond on April 30, 2008, 10:11 am
Please log in for more thread options
> After testing different parameters, I'm still unable to obtain 2 transparent
> circles. Could anybody tell me what's wrong in the following codes?
>
> #!/usr/bin/perl
> use GD;
>
> $im = new GD::Image(550,450);
> $white = $im->colorAllocate(255,255,255);
> $black = $im->colorAllocate(0,0,0);
> $red = $im->colorAllocateAlpha(255,0,0,119);
> $blue = $im->colorAllocateAlpha(0,0,255,119);
> $im->transparent($white);
> $im->alphaBlending(1);
> $im->setStyle($black);
>
> $im->filledArc(460,380,95,75,0,360,$red);
> $im->filledArc(500,380,95,75,0,360,$blue);
>
> open(IMG, ">test.png");
> binmode IMG;
> print IMG $im->png;
> close IMG;
"Blending mode is not available when drawing on palette images."
You need to be in true color mode, the default is palette mode.
--S
|