Re: [GD-DEVEL] Help with drawing lines

[email protected] (Pierre Joye) Wed, 14 Oct 2009 14:51:31 +0200
Newsgroups php.gd.devel
Message-ID <[email protected]>
hi,

I don't the image, can you send it again pls?

On Wed, Oct 14, 2009 at 2:48 PM, Aleksandar Nedeljkovic
<[email protected]> wrote:
> Hi,
> I need to draw a various types of lines, and I have a problem with drawing
> dashed lines with width greater then 1 pixel.
> Here is my code:
> #include "gd.h"
> #include <stdio.h>
> int main() {
> gdImagePtr im;
> int styleDotted[2], styleDashed[6];
> FILE * jpegout;
> int black;
> int red;
> im = gdImageCreate(100, 100);
> black = gdImageColorAllocate(im, 0, 0, 0);
> red = gdImageColorAllocate(im, 255, 0, 0);
> styleDashed[0] = red;
> styleDashed[1] = red;
> styleDashed[2] = red;
> styleDashed[3] = red;
> styleDashed[4] = gdTransparent;
> styleDashed[5] = gdTransparent;
> gdImageSetThickness(im, 2);
> gdImageSetStyle(im, styleDashed, 6);
> gdImageLine(im, 0, 12, 99, 12, gdStyled);
> jpegout = fopen("test3.jpg", "wb");
> gdImageJpeg(im, jpegout, -1);
> fclose(jpegout);
> gdImageDestroy(im);
> return 0;
> }
> Image created with this program is in attachment. Did I miss something, or
> what?
> Thanks in advance.
> --
> GD Devel Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org