I am having problems with Image Transparency, My images I have go in as Transparent, but when I out put them, they arent. Am I doing my imagetransparency function wrong?
PHP Code:function player($guy, $shirt) {
$image = ImageCreateTrueColor($im_x_guy, $im_y_guy);
$im_guy = ImageCreateFromPNG("images/rpg/clothing/$guy");
$im_x_guy = ImageSX($im_guy);
$im_y_guy = ImageSY($im_guy);
$im_color = ImageColorAllocate($image, 0, 0, 0);
ImageColorTransparent($image, $im_color);
ImageCopy($image, $im_guy, 0, 0, 0, 0, $im_x_guy, $im_y_guy);
if ($shirt !== '0'){
$im_shirt = ImageCreateFromPNG("images/rpg/clothing/$shirt");
$im_x_shirt = ImageSX($im_shirt);
$im_y_shirt = ImageSY($im_shirt);
ImageCopy($image, $im_shirt, 0, 0, 0, 0, $im_x_shirt, $im_y_shirt);
}
header ("Content-type: image/png");
ImagePNG($image);
ImageDestroy($image);}
Any help would be GREATLY apreciated.




Reply With Quote