各位大哥,为什么我用GD画不出图来啊?

Qt-UI 2006-01-19 05:32:18
以前用GD画图从来没出过问题
今天用她画柱状图,竟然画不出来,在本地一点问题都没有,传到服务器上问题就来拉```
急死人拉````
实在是郁闷啊`
各位,帮帮我看看怎么回事啊
页面是
http://www.hubce.edu.cn/dst/forum/
就是下面的那个投票的柱图显示不出来,明明写了的```
<?php
function drowPic($array)
{
$image = ImageCreateFromJPEG('./vote/rf.jpg');
$font="./font/FZZDXJW.ttf";
$blue=imagecolorallocate($image,7,129,254);
$white=imagecolorallocate($image,255,255,255);
$red=imagecolorallocate($image,255,0,0);
$black=imagecolorallocate($image,0,0,0);
$scal=1.00;
$strpos=25;
$fillpos=30;
imagefilledrectangle($image,10,105,490,104.5,$black);//这里显示不出来
imagefilledrectangle($image,10,105,10,105-100,$white);//这里显示不出来

for($i=1;$i<11;$i++)
{
$x1=10;
$y1=105-10*$i;
$x2=$x1+470;
$y2=$y1;
imagefilledrectangle($image,$x1,$y1,$x2,$y2,$white);
if(10==$i)imagettftext($image,10,0,$x2,$y2+5,$black,$font,$i);else
imagettftext($image,10,0,$x2+5,$y2+5,$black,$font,$i);
}

foreach($array as $ar)
{
$length=$ar['len']*$scal;
imagefilledrectangle($image,$fillpos,105,$fillpos+20,105-$length,$black);//这里显示不出来
$str=iconv("gb2312","utf-8",$ar['num']);
imagettftext($image,10,0,$fillpos-5,100-$length,$red,$font,$str);
$str=iconv("gb2312","utf-8",$ar['name']);
imagettftext($image,10,0,$fillpos-5,85-$length,$black,$font,$str);
$fillpos+=50;
}
$content=ImagePNG($image,'./vote/vote.png');
imagedestroy($image);
return $content;
}
?>
...全文
197 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuzuning 2006-01-20
  • 打赏
  • 举报
回复
可能是服务器端的gd有问题
尝试改用imagefilledpolygon
Qt-UI 2006-01-20
  • 打赏
  • 举报
回复
唠叨大哥就是厉害...
呵呵
服务器端GD问题
换用imagefilledpolygon就好了
谢谢拉``
Qt-UI 2006-01-19
  • 打赏
  • 举报
回复
部分代码没有在图上表现出来```少画了些东西```
Qt-UI 2006-01-19
  • 打赏
  • 举报
回复
肯定支持```
bigluckyfox 2006-01-19
  • 打赏
  • 举报
回复
首先你要确定你那服务器上是否支持GD?

21,890

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧