CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: php gd problem

  1. #1
    Join Date
    Dec 2005
    Location
    algiers, Algeria
    Posts
    132

    php gd problem

    hi all, i am using GD library of php
    Code:
    $x = 200; //largeur de mon image en PIXELS uniquement !
    $y = 200; //hauteur de mon image en PIXELS uniquement !
    
    $image = imagecreatetruecolor($x,$y);
    
    $couleur = imagecolorallocate($image,255,0,0);
    
    $coords = array('5','5',          // point 1
                    '190', '190',     // point 2
                    '160','40');      // point 3
    
    imagefilledpolygon($image,$coords,3,$couleur);
    imagepng($image,"1.png");
    imagedestroy($image);
    the polygon did not filled with the red color why

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: php gd problem

    You haven't declared that it's output should be an image.

    PHP Code:
    header('Content-type: image/png'); 
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

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

Featured