I need to draw simple arcs on an image -- and the line thickness needs to be adjustable.
Drawing the ImageArc() function repeatedly while decrementing the size variable creates a thick line but not all pixels are filled and the background color bleeds through.
Any suggestions appreciated.
Tom
how set line thickness of arc
Moderator: General Moderators
Re: how set line thickness of arc
imagesetthickness() maybe ?
Re: how set line thickness of arc
thanks -- I knew I had to be missing something -- and thank you for taking the time to reply.
But -- the line now looks really bad.
The code I used for a thickness of 15 is:
It looks much better if I just draw the arc 15 times with it being 1 pixel smaller each time -- but still doesn't look very good.
Image with example of each method attached.
Tom
But -- the line now looks really bad.
The code I used for a thickness of 15 is:
Code: Select all
imagesetthickness($img, 15);
ImageArc($img, $center, $center, $size, $size, 166, 0, $black) ;Code: Select all
$thickness = 15 ;
for ($sizet = $size ; $sizet > $size - $thickness ; $sizet = $sizet - 1) {
ImageArc($img, $center, $center, $sizet, $sizet, 166, 0, $black) ;
}- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: how set line thickness of arc
GD isn't exactly my strength, so I'll leave you to a user comment.
Re: how set line thickness of arc
I already tried that -- it looks like my own solution, except his centers the width on the arc and mine builds the line width inside the arc.
Neither returns a pixel width equal to the chosen width value, and both look ragged with the background bleeding through.
thanks,
Tom
Neither returns a pixel width equal to the chosen width value, and both look ragged with the background bleeding through.
thanks,
Tom