SORU
23 Kasım 2008, Pazar


PNG PHP ile Şeffaflık

Bazı sorunlar bir küçük resim oluşturmak zaman bir png şeffaflık sağlamak için çalışıyor yaşıyor, Hey kimse bu herhangi bir deneyim? herhangi bir yardım iyi olurdu, burada şu anda bunu yapıyorum:

$fileName= "../js/ajaxupload/tees/".$fileName;

list($width, $height) = getimagesize($fileName);

$newwidth = 257;
$newheight = 197;

$thumb = imagecreatetruecolor($newwidth, $newheight);
imagealphablending($thumb, true);
$source = imagecreatefrompng($fileName);
imagealphablending($source, true);

imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

imagesavealpha($thumb, true);
imagepng($thumb,$newFilename);

CEVAP
23 Kasım 2008, Pazar


Başarı geçmişte bu gibi yaparken buldum

$thumb = imagecreatetruecolor($newwidth, $newheight);
imagealphablending($thumb, false);
imagesavealpha($thumb, true);  

$source = imagecreatefrompng($fileName);
imagealphablending($source, true);

imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

imagepng($thumb,$newFilename);

Çıkış görüntü kalitesi çok iyi imagecopyresampled() imagecopyresized() Daha kullanarak buldum

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Adam Washington

    Adam Washing

    12 Mayıs 2006
  • LiquidMusick

    LiquidMusick

    23 Aralık 2010
  • SignatureSeries

    SignatureSer

    24 Aralık 2006