Good morning experts one and all!

I am trying to draw an arc 20 pixels wide. Unfortunately, imagearc() only draws a one pixel line while imagefilledarc() does not fill the arc to a specified depth (just various "pie" fillings).

So I tried a loop to draw 20 one-pixel lines. For some reason however, it appears that some pixels are dropped. This makes for a messy fill leaving black spots (or any background color) in the line. Attached is an example and the code is below.

What is the best way to draw a "thick" arc?

Thank you in advance for your kindness 🙂
PS. How do you insert an image into messages on this board using the img tags?

$img = imagecreatetruecolor(214, 345);
$white = imagecolorallocate($img, 255, 255, 255);
$red   = imagecolorallocate($img, 255,   0,   0);
for ($Cnt = 1; $Cnt <= 20; $Cnt++) {
	$Measure = 300 + $Cnt;
	imagearc($img, 20, 172, $Measure, $Measure, 315, 45, $white);
}

    I tried using [man]imagesetthickness[/man] to set the thickness of the lines it drew with, but using it to just draw a single thick arc had such a ghastly result that it would be worth filing a bug report. But it can be used to make the lines just thick enough. Add

    imagesetthickness($img,2)

    prior to starting the loop. See if that is effective at plugging the holes.

      Write a Reply...