note 61693 added to function.imagecopy

From: Date: Thu, 09 Feb 2006 19:38:04 +0000
Subject: note 61693 added to function.imagecopy
Groups: php.notes 
Request: Send a blank email to php-notes+get-103382@lists.php.net to get a copy of this message
Skewing images in PHP... <?php function Skew($src, $dest, $skew_val) { $imgsrc = imagecreatefromgif($src); $width = imagesx($imgsrc); $height = imagesy($imgsrc); $imgdest = imagecreatetruecolor($width, $height+($height*$skew_val)); $trans = imagecolorallocate($imgdest,0,0,0); $temp=0; for($x=0 ; $x<$width ; $x++) { for($y=0 ; $y<$height ; $y++) { imagecopy($imgdest, $imgsrc, $x, $y+$temp, $x, $y, 1, 1); imagecolortransparent($imgdest,$trans); } $temp+=$skew_val; } imagepng($imgdest, $dest); imagedestroy($imgsrc); imagedestroy($imgdest); } Skew("img.gif", "img2.png","1"); print "<img src='img.gif'>"; print "<br><br>"; print "<img src='img2.png'>"; ?> ---- Server IP: 203.199.107.94 Probable Submitter: 59.144.19.199 ---- Manual Page -- http://www.php.net/manual/en/function.imagecopy.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61693 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61693&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61693&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61693&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61693&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61693&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61693&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61693&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61693&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103382) next »