|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-11-13 13:46 UTC] ssb
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 01:00:01 2025 UTC |
The following script creates a solid black circle in PHP 3.0.4, but in 3.0.5 the call to imagearc fails. It appears I can draw an arc of at most 360 degrees, which is insufficent for creating a closed loop on circles with diameters bigger than about 200 pixels. Looks like an off-by-one bug. <? $ChartDiameter = 300; $ChartWidth = $ChartDiameter + 20; $ChartHeight = $ChartDiameter + 20 + (($ChartFontHeight + 2) * count($ChartData)); $ChartCenterX = $ChartDiameter/2 + 10; $ChartCenterY = $ChartDiameter/2 + 10; //create image $image = imagecreate($ChartWidth, $ChartHeight); //allocate colors $colorBody = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); $colorBorder = imagecolorallocate($image, 0x00, 0x00, 0x00); //fill background imagefill($image, 0, 0, $colorBody); //draw border imagearc($image, $ChartCenterX, $ChartCenterY, $ChartDiameter+7, $ChartDiameter+7, 0, 360, $colorBorder); imagefilltoborder($image, $ChartCenterX, $ChartCenterY, $colorBorder, $colorBorder); //output image header("Content-type: image/gif"); imagegif($image); ?>