note 8964 deleted from function.imagecolorallocate by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 19:51:37 +0000 |
| Subject: | note 8964 deleted from function.imagecolorallocate by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22135@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.