note 47035 added to ref.image
| From: | andreaskalschatgmxdotde at osu1 dot php dot net | Date: | Sun, 31 Oct 2004 20:18:30 +0000 |
| Subject: | note 47035 added to ref.image | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-79415@lists.php.net to get a copy of this message | ||
These two are functions to flip an image (in true color)
- vertically:
function image_flip_vertical($im)
{
$x_i = imagesx($im);
$y_i = imagesy($im);
$im_ = imagecreatetruecolor($x_i, $y_i);
for ($x = 0; $x < $x_i; $x++)
{
for ($y = 0; $y < $y_i; $y++)
{
imagecopy($im_, $im, $x_i - $x - 1, $y, $x, $y, 1, 1);
}
}
return $im_;
}
- horizontally:
function image_flip_horizontal($im)
{
$x_i = imagesx($im);
$y_i = imagesy($im);
$im_ = imagecreatetruecolor($x_i, $y_i);
for ($x = 0; $x < $x_i; $x++)
{
for ($y = 0; $y < $y_i; $y++)
{
imagecopy($im_, $im, $x, $y_i - $y - 1, $x, $y, 1, 1);
}
}
return $im_;
}
I think there is no gd function to do the same.
----
Manual Page -- http://www.php.net/manual/en/ref.image.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47035
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47035&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47035&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47035&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47035&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47035&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47035&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47035&report=yes
Search -- http://master.php.net/manage/user-notes.php