List Info

Thread: note 61693 added to function.imagecopy




note 61693 added to function.imagecopy
user name
2006-02-09 19:38:04
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 -- h
ttp://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 -- htt
p://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.p
hp.net/manage/user-notes.php?action=delete+61693&report=
yes&reason=useless
Delete: non-english         -- http://mast
er.php.net/manage/user-notes.php?action=delete+61693&rep
ort=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://ma
ster.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )