cvs: phpdoc /en/reference/image/functions imagecolorallocate.xml

From: Date: Mon, 02 Jan 2006 09:14:22 +0000
Subject: cvs: phpdoc /en/reference/image/functions imagecolorallocate.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969371405@lists.php.net to get a copy of this message
mazzanet Mon Jan 2 09:14:22 2006 UTC Modified files: /phpdoc/en/reference/image/functions imagecolorallocate.xml Log: Note the requirements of setting the background colour and fix example http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/image/functions/imagecolorallocate.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/image/functions/imagecolorallocate.xml diff -u phpdoc/en/reference/image/functions/imagecolorallocate.xml:1.8 phpdoc/en/reference/image/functions/imagecolorallocate.xml:1.9 --- phpdoc/en/reference/image/functions/imagecolorallocate.xml:1.8 Wed Aug 10 04:48:11 2005 +++ phpdoc/en/reference/image/functions/imagecolorallocate.xml Mon Jan 2 09:14:22 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.36 --> <refentry id="function.imagecolorallocate"> <refnamediv> @@ -18,9 +18,8 @@ <para> <function>imagecolorallocate</function> returns a color identifier representing the color composed of the given - <acronym>RGB</acronym> components. The <parameter>image</parameter> - argument is the return from the <function>imagecreatetruecolor</function> - function. <parameter>red</parameter>, <parameter>green</parameter> and + <acronym>RGB</acronym> components. + <parameter>red</parameter>, <parameter>green</parameter> and <parameter>blue</parameter> are the values of the red, green and blue component of the requested color respectively. These parameters are integers between 0 and 255 or hexadecimals between 0x00 and 0xFF. @@ -31,7 +30,8 @@ <note> <para> The first call to <function>imagecolorallocate</function> fills - the background color. + the background color in palette-based images - images created using + <function>imagecreate</function>. </para> </note> <para> @@ -40,9 +40,11 @@ <![CDATA[ <?php -$im = imagecreatetruecolor('example.jpg'); +$im = imagecreatetruecolor('example.jpg', 100, 100); + // sets background to red -$background = imagecolorallocate($im, 255, 0, 0); +$red = imagecolorallocate($im, 255, 0, 0); +imagefill($im, 0, 0, $red); // sets some colors $white = imagecolorallocate($im, 255, 255, 255);

« previous php.doc (#969371405) next »