note 32893 added to function.imagecolorat

From: Date: Tue, 10 Jun 2003 09:35:29 +0000
Subject: note 32893 added to function.imagecolorat
Groups: php.notes 
Request: Send a blank email to php-notes+get-50086@lists.php.net to get a copy of this message
The HTML image renderer didn't work for me for some reason, but here's a version that does... echo '<table border="0" cellspacing="0" cellpadding="0">'; $im = ImageCreateFromJPEG("IMAGE NAME"); $width = imagesx($im); $height = imagesy($im); for ($cy=0;$cy<$height;$cy++) { echo '<tr>'; for ($cx=0;$cx<$width;$cx++) { $rgb = ImageColorAt($im, $cx, $cy); $col = imagecolorsforindex($im, $rgb); printf('<td width="2" height="2" bgcolor=#%02x%02x%02x></td>', $col["red"], $col["green"], $col["blue"]); } echo '</tr>'; } echo '</table>'; ---- Manual Page -- http://www.php.net/manual/en/function.imagecolorat.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32893 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32893&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32893&report=yes

« previous php.notes (#50086) next »