Reply to thumbnails of transparent background gifs

Your name:

Reply:


Posted by salmobytes on 09/27/07 14:34

The following resize stuff does not work for gifs with transparent
backgrounds. What would make it work?

function Create()
{
switch($this->ImageType)
{
case ".gif":
$this->ImageObj =
imagecreatefromgif($this->ImageUrl);
break;
//snip other cases

}
}

function ResizePct($Percent)
{
list($Width, $Height) = getimagesize($this->ImageUrl);
$NewWidth = intval(($Width * $Percent) / 100);
$NewHeight = intval(($Height * $Percent) / 100);

$this->ResizedImage = imagecreatetruecolor($NewWidth,
$NewHeight);
imagecopyresampled($this->ResizedImage, $this-
>ImageObj, 0, 0, 0, 0,
$NewWidth,
$NewHeight, $Width, $Height);

switch($this->ImageType)
{
case ".gif":
imagegif($this->ResizedImage,$this-
>ThumbnailUrl);
break;
//snip other cases

}
}

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация