Hi all.
I'm trying to get drawing with a brush working in PHP, but the transparent areas of my brush are coming out black and I don't know why. My code is at the botom of this post. Does anyone have any idea why this might be happening?
Cheers,
Dan.
<?
Header("Content-Type: image/png");
$image = ImageCreate(500,500);
$white = ImageColorAllocate($image, 255, 255, 255);
imagefill($image,0,0,$white);
$brushimage=createbrushimage(55);
imagesetbrush($image,$brushimage);
imageline($image,50,50,100,50,IMG_COLOR_BRUSHED);
imagepng($image);
function createbrushimage($intsize)
{
$brushimage = ImageCreate($intsize,$intsize);
$green = ImageColorAllocate($brushimage, 0,255,0);
$white = ImageColorAllocate($brushimage, 255,255,255);
$red = ImageColorAllocate($brushimage, 255,0,0);
imagefill($brushimage,$intsize/2,$intsize/2,IMG_COLOR_TRANSPARENT );
imageellipse($brushimage,$intsize/2,$intsize/2,$intsize,$intsize,$red);
imagefill($brushimage,$intsize/2,$intsize/2,$red);
return $brushimage;
}
?>