各位大哥,为什么我用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;
}
?>