Why imagefill always black?

Discussion in 'PHP' started by thosecars82, Dec 14, 2009.

  1. #1
    Hello guys
    This is driving me mad. I would really appreciate if you told me any idea about why I see this square in red color just in my local xampp installation. If I run the code in the remote server (http://www.arreglaordenador.com/numberimage2.php) I see the square in black color instead of red. Do you have any ideas?
    
    <?php
     
    $im = imagecreatetruecolor(100, 100);
     
    // sets background to red
    $red = imagecolorallocate($im, 255, 0, 0);
    imagefill($im, 0, 0, $red);
     
    header('Content-type: image/png');
    imagepng($im);
    imagedestroy($im);
    ?> 
    
    Code (markup):
    Thanks
     
    thosecars82, Dec 14, 2009 IP
  2. eXe

    eXe Notable Member

    Messages:
    4,643
    Likes Received:
    248
    Best Answers:
    0
    Trophy Points:
    285
    #2
    imagefill($im, 1, 1, $red);
     
    eXe, Dec 14, 2009 IP