关于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色图片了。不过一般除了影片片段截图等特殊情况也不会有真彩的 php 连接sqlserver 时 镜像的问题 PHP页面不显示mysql中内容 服务器上取不到session! web服务器为IIS 帮下忙咯 在线等 请问PHP连接oracle数据库代码 在php,linux环境下配置FCKeditor的问题 如何避免网页不被连续的符号拉长? php strlen 计算字节与字符 与 编码的问题 php新手求教 新人求助,如何点击数据库标题后跳转详细页面显示内容 帮我看看乱码的原因 关于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的这种获取方式不对
不过一般除了影片片段截图等特殊情况也不会有真彩的