note 11530 added to ImageColorAllocate

From: Date: Fri, 23 Feb 2001 15:13:27 +0000
Subject: note 11530 added to ImageColorAllocate
Groups: php.notes 
Request: Send a blank email to php-notes+get-11478@lists.php.net to get a copy of this message
This seems to be true, although to prevent this kind of unexpected result, you'd normally use an ImageFill before drawing anything else to explicitly set the bg color. /* begin quote */ yaxinwen@eyou.com wrote at 09-Oct-2000 11:21: It seems that the first color allocated in an image will be the background color. Example: <?php Header("Content-type:&nbsp;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. /* end quote */ http://www.php.net/manual/en/function.imagecolorallocate.php

« previous php.notes (#11478) next »