note 61081 added to function.imagecolorallocatealpha
| From: | (at) | Date: | Wed, 25 Jan 2006 09:41:16 +0000 |
| Subject: | note 61081 added to function.imagecolorallocatealpha | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-102407@lists.php.net to get a copy of this message | ||
If you only wish to extract the alpha value for a color, you can simply extract it like so:
<?php
$color = imagecolorat($im, 50, 50);
$alpha = $color >> 24;
?>
It actually shifts off the first 24 bits (where 8x3 are used for each color), and returns the
remaining 7 allocated bits (commonly used for alpha)
----
Server IP: 83.137.20.120
Probable Submitter: 194.109.161.164
----
Manual Page -- http://www.php.net/manual/en/function.imagecolorallocatealpha.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61081
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61081&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61081&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61081&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61081&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61081&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61081&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61081&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61081&report=yes
Search -- http://master.php.net/manage/user-notes.php