background color imagefill

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thosecars82
Forum Commoner
Posts: 94
Joined: Thu Apr 03, 2008 6:31 am
Location: Arganda, Madrid
Contact:

background color imagefill

Post by thosecars82 »

Hello

I would like to ask you 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?

Code: Select all

 
<?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);
?> 
 
Thanks
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: background color imagefill

Post by requinix »

thosecars82 wrote: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.
I don't. Looks red to me.
Post Reply