note 76819 added to function.imagecolorat
| From: | markignore dot atsymbol dot ignorepnod dot co dot uk at osu1 dot php dot net | Date: | Tue, 31 Jul 2007 23:58:58 +0000 |
| Subject: | note 76819 added to function.imagecolorat | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129090@lists.php.net to get a copy of this message | ||
The example given for returning the RGB values from the function (using & 0xFF) didn't work
for me for PNG or GIF images. If you have this problem, try the following (which works):
<?php
$pixelrgb = imagecolorat($source,$x,$y);
$cols = imagecolorsforindex($source, $pixelrgb);
$r = $cols['red'];
$g = $cols['green'];
$b = $cols['blue'];
?>
----
Server IP: 87.124.64.96
Probable Submitter: 81.79.180.41
----
Manual Page -- http://www.php.net/manual/en/function.imagecolorat.php
Edit -- https://master.php.net/note/edit/76819
Del: integrated -- https://master.php.net/note/delete/76819/integrated
Del: useless -- https://master.php.net/note/delete/76819/useless
Del: bad code -- https://master.php.net/note/delete/76819/bad+code
Del: spam -- https://master.php.net/note/delete/76819/spam
Del: non-english -- https://master.php.net/note/delete/76819/non-english
Del: in docs -- https://master.php.net/note/delete/76819/in+docs
Del: other reasons-- https://master.php.net/note/delete/76819
Reject -- https://master.php.net/note/reject/76819
Search -- https://master.php.net/manage/user-notes.php