Ana Sayfa En Yeni 50 Kod En Popüler 50 Kod Sen de Yaz Bize Ulaşın
Sponsorlar
Programlama > PHP


Deforme etmeden resize

Herhangibir resim dosyasını deforme etmeden küçültme için bi php kod.

<?php
/* Aşşağıdaki kod ile istenilen resim dosyazını deforme etmeden küçültebiliriz */
// resim dosyası gir.
$image = "";

define("VERTICAL", 1);
define("HORIZONTAL", 2);

function imageflip($image, $mode) {
$w = imagesx($image);
$h = imagesy($image);
$flipped = imagecreate($w, $h);
if ($mode & VERTICAL) {
for ($y = 0; $y < $h; $y++) {
imagecopy($flipped, $image, 0, $y, 0, $h - $y - 1, $w, 1);
}
}
if ($mode & HORIZONTAL) {
for ($x = 0; $x < $w; $x++) {
imagecopy($flipped, $image, $x, 0, $w - $x - 1, 0, 1, $h);
}
}
return $flipped;
}
?>

emrah ülker
emrah@planesoft.net
Ana Sayfa   Ana sayfam yap   Favorilerime ekle   Bize Ulaşın
© 2002 - 2010 Hazır Kod Programlama - Türkiye