http://topic.csdn.net/u/20071202/20/7eafcdc7-186a-4869-a54b-e32ddd011b29.html

解决方案 »

  1.   

    楼上的答非所问
    有没有高手路过的?能给说明下不?是不是php做不到?就只能这样?
      

  2.   

    顶,感兴趣的也帮忙顶下啊:P哪位给说说啊。
    <?php $tmp1 = imagecreatefromgif("src.gif");
    $old_x = imageSX($tmp1);
    $old_y = imageSY($tmp1);
    $im = imagecreatetruecolor($old_x,$old_y);$trnprt_indx = imagecolortransparent($tmp1);
    if ($trnprt_indx >= 0) {
    $trnprt_color    = imagecolorsforindex($tmp1, $trnprt_indx);
    $trnprt_indx    = imagecolorallocate($im, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']); imagefill($im, 1, 1, $trnprt_indx);
    imagecolortransparent($im, $trnprt_indx);}imagecopyresized ( $im, $tmp1,  0, 0, 0, 0, $old_x, $old_y, $old_x, $old_y );
    imagegif($im,   "dst.gif "); 
    Imagedestroy($im); ?> 这样写同样不行,问题似乎出在php无法正确获取透明色,或者php的这种获取方式不对
      

  3.   

    问题结贴吧,对于生成gif的图片只能选择imagecreate($old_x,$old_y);256色图片了。
    不过一般除了影片片段截图等特殊情况也不会有真彩的