note 97193 added to function.imagerotate
| From: | elvios at c18-ss-2-lb dot cnet dot com | Date: | Wed, 07 Apr 2010 18:45:43 +0000 |
| Subject: | note 97193 added to function.imagerotate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-167954@lists.php.net to get a copy of this message | ||
Alteration to kmrohe's function, so it rotates both 90 degrees CW and CCW.
<?php
function KmroheRotate($image, $rotation) {
$width = imagesx($image);
$height = imagesy($image);
$newimage = imagecreatetruecolor($height, $width);
imagealphablending($newimage, false);
imagesavealpha($newimage, true);
for ( $w=0; $w<$width; $w++)
for ( $h = 0 ; $h<$height ; $h++) {
$reference = imagecolorat($image, $w, $h);
if ( $rotation == "90" ) {
imagesetpixel($newimage, $h, ($width - 1) - $w, $reference);
} else {
imagesetpixel($newimage, ($height - 1) - $h, $w, $reference);
}
}
return $newimage;
}
?>
----
Server IP: 87.54.44.10
Probable Submitter: 212.45.121.172
----
Manual Page -- http://www.php.net/manual/en/function.imagerotate.php
Edit -- https://master.php.net/note/edit/97193
Del: integrated -- https://master.php.net/note/delete/97193/integrated
Del: useless -- https://master.php.net/note/delete/97193/useless
Del: bad code -- https://master.php.net/note/delete/97193/bad+code
Del: spam -- https://master.php.net/note/delete/97193/spam
Del: non-english -- https://master.php.net/note/delete/97193/non-english
Del: in docs -- https://master.php.net/note/delete/97193/in+docs
Del: other reasons-- https://master.php.net/note/delete/97193
Reject -- https://master.php.net/note/reject/97193
Search -- https://master.php.net/manage/user-notes.php