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

  • ChannelRichard

    ChannelRicha

    7 Kasım 2008
  • CruzerLite

    CruzerLite

    1 EKİM 2011
  • POGProductionz

    POGProductio

    27 NİSAN 2012

İLGİLİ SORU / CEVAPLAR