关于php缩放gif图片中透明底的问题 http://topic.csdn.net/u/20071202/20/7eafcdc7-186a-4869-a54b-e32ddd011b29.html 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼上的答非所问有没有高手路过的?能给说明下不?是不是php做不到?就只能这样? 顶,感兴趣的也帮忙顶下啊: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的这种获取方式不对 问题结贴吧,对于生成gif的图片只能选择imagecreate($old_x,$old_y);256色图片了。不过一般除了影片片段截图等特殊情况也不会有真彩的 伪静态IIS的,求帮助给分。 怎样才能修改Linux口令 一道面试题php读2G文件 fsockopen用127.0.0.1好用,用localhost不好用,求高手指点 php excel问题 小弟遇到一难题 求大神帮忙 请教php怎么访问access数据库 论坛中回复帖子的程序,一点问题 请问用PHP如何打开WORD 请教php post 提交限制问题。 帮我看看乱码的原因 关于xampp的首页
有没有高手路过的?能给说明下不?是不是php做不到?就只能这样?
<?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的这种获取方式不对
不过一般除了影片片段截图等特殊情况也不会有真彩的