note 64862 added to ref.image
| From: | php at synvb dot com | Date: | Sat, 22 Apr 2006 03:19:19 +0000 |
| Subject: | note 64862 added to ref.image | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-108977@lists.php.net to get a copy of this message | ||
Here is a single-function to flip, based on the one below.
<?php
function flipImage($image, $vertical, $horizontal) {
$w = imagesx($image);
$h = imagesy($image);
if (!$vertical && !$horizontal) return $image;
$flipped = imagecreatetruecolor($w, $h);
if ($vertical) {
for ($y=0; $y<$h; $y++) {
imagecopy($flipped, $image, 0, $y, 0, $h - $y - 1, $w, 1);
}
}
if ($horizontal) {
if ($vertical) {
$image = $flipped;
$flipped = imagecreatetruecolor($w, $h);
}
for ($x=0; $x<$w; $x++) {
imagecopy($flipped, $image, $x, 0, $w - $x - 1, 0, 1, $h);
}
}
return $flipped;
}
?>
----
Server IP: 216.194.113.175
Probable Submitter: 24.162.120.41
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/ref.image.php
Edit -- http://master.php.net/note/edit/64862
Del: integrated -- http://master.php.net/note/delete/64862/integrated
Del: useless -- http://master.php.net/note/delete/64862/useless
Del: bad code -- http://master.php.net/note/delete/64862/bad+code
Del: spam -- http://master.php.net/note/delete/64862/spam
Del: non-english -- http://master.php.net/note/delete/64862/non-english
Del: in docs -- http://master.php.net/note/delete/64862/in+docs
Del: other reasons-- http://master.php.net/note/delete/64862
Reject -- http://master.php.net/note/reject/64862
Search -- http://master.php.net/manage/user-notes.php