note 99443 deleted from function.imagecopy by danbrown
| From: | danbrown@php.net | Date: | Wed, 18 Aug 2010 15:53:29 +0000 |
| Subject: | note 99443 deleted from function.imagecopy by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-171813@lists.php.net to get a copy of this message | ||
Note Submitter: elpie.sote.pl
----
I have php4 in my hosting and this function didn't work, maybe i need PHP5 ????????
<?php
function backgroundify(&$image) {
$ix = imagesx($image);
$iy = imagesy($image);
$ixhalf = floor($ix / 2); // DON'T USE ON IMAGES WITH ODD SIZES!
$iyhalf = floor($iy /2);
$panel_temp = ImageCreate ($ix, $iy) or die("Cannot Initialize new GD image stream");
imagecopy($panel_temp, $image, 0,0,0,0,$ix, $iy);
imagecopy($image, $panel_temp, 0,0,$ixhalf,$iyhalf, $ix-$ixhalf, $iy-$iyhalf); // move bottom
right to top left
imagecopy($image, $panel_temp, $ixhalf,$iyhalf, 0,0,$ix-$ixhalf, $iy-$iyhalf); // top left to
bottom right
imagecopy($image, $panel_temp, $ixhalf, 0,0,$iyhalf,$ix-$ixhalf, $iy-$iyhalf); // bottom left to
topo right
imagecopy($image, $panel_temp, 0,$iyhalf, $ixhalf,0,$ix-$ixhalf, $iy-$iyhalf); // top left to
bottom right
}
?>
elpie.sote.pl