note 61749 added to function.imagecopy

From: Date: Fri, 10 Feb 2006 20:28:00 +0000
Subject: note 61749 added to function.imagecopy
Groups: php.notes 
Request: Send a blank email to php-notes+get-103470@lists.php.net to get a copy of this message
Here's an alternative image-flipping function which is simpler than either of the ones I've seen in the docs here. It takes the source image and the mode (zero for horizontal, nonzero for vertical) and returns the flipped image. <?php function imageflip($image, $mode) { $w = imagesx($image); $h = imagesy($image); $flipped = imagecreate($w, $h); if ($mode) { for ($y = 0; $y < $h; $y++) { imagecopy($flipped, $image, 0, $y, 0, $h - $y - 1, $w, 1); } } else { for ($x = 0; $x < $w; $x++) { imagecopy($flipped, $image, $x, 0, $w - $x - 1, 0, 1, $h); } } return $flipped; } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 66.92.15.102 ---- Manual Page -- http://www.php.net/manual/en/function.imagecopy.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61749 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61749&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61749&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61749&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61749&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61749&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61749&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61749&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61749&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103470) next »