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

  • PamtheBlamofficial

    PamtheBlamof

    31 Aralık 2010
  • sonia989

    sonia989

    26 EKİM 2006
  • The Brister

    The Brister

    10 ŞUBAT 2008