Does the "imagerotate" function in PHP5 work correctly or am I doing
something wrong?
I'm using the code shown below to generate a simple rectangle and then
to rotate it a specific number of degrees. The actual rotation itself
seems to happen OK but the background color appears correctly only if
the rotation is between 1 and 45 degrees; any other value and the
background is black. And, in neither case does the
"imagecolortransparent" work (I want the background to be
transparent).
$myImg = imagecreate($somelength,$somewidth);
$myBG = imagecolorallocate($myImg,85,255,255);
$RectColor = imagecolorallocate($myImg,200,200,200);
$myBlack = imagecolorallocate($myImg, 0, 0, 0);
imagefilledrectangle($myImg,1,1,($somelength-2),($somewidth-2),
$RectColor);
imagerectangle($myImg,0,0,($somelength-1),($somewidth-1), $myBlack);
$myImage = imagerotate($myImg, $someangle, $myBG);
imagedestroy($myImg);
imagecolortransparent($myImage,$myBG);
imagepng($myImage,"gMyRect.png");
imagedestroy($myImage);