Results 1 to 1 of 1

Thread: alpha with the gd library

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    121

    alpha with the gd library

    Hello all.
    I'm developing a Flash app in which the user traces his or her face. Done. The coordinates are being sent to a PHP page which fills a polygon. Done. Now what I would like to do is instead of filling the polygon, convert it to alpha. Can this be done? I'm attaching my code and a screenshot of what I've done so far.
    Any help is appreciated.
    Code:
    <?
        /* INITIALIZE A VARIABLE */
            $coordinates=substr($_GET['c'],0,strlen($_GET['c'])-1);
        /* BUILD AN ARRAY */
            $temp=split(',',$coordinates);
        /* CREATE THE IMAGE */
            $image=imagecreatetruecolor(400, 370);
        /* USE A FILL */
            $fill_color=imagecolorallocate($image, 255, 255, 255);
        /* DRAW IT */
            imagefilledpolygon($image, $temp, (count($temp)/2), $fill_color);
        /* SET THE HEADER */
            header('Content-type: image/png');
        /* FLUSH THE IMAGE */
            imagepng($image);
            imagedestroy($image);
    ?>
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width