note 8964 added to ImageColorAllocate
| From: | yaxinwen at eyou dot com | Date: | Mon, 09 Oct 2000 15:21:41 +0000 |
| Subject: | note 8964 added to ImageColorAllocate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6236@lists.php.net to get a copy of this message | ||
It seems that the first color allocated in an image will be the background color.
Example:
<?php
Header("Content-type: image/gif");
$image = ImageCreate(200, 200);
$red = ImageColorAllocate($image, 255, 0,0);
$blue = ImageColorAllocate($image, 0, 0, 255);
ImageRectangle($image, 50, 50, 150, 150, $blue);
ImageGIF($image);
ImageDestory($image);
?>
You'll see a blue rectangle on a red background.
http://www.php.net/manual/function.imagecolorallocate.php