关于PHP画图的问题 对,要先将php.ini中的bg2.dll这个前的去掉啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 新版本的gd不支持gif。用png吧 <?PHPheader("Content-type: image/gif"); $image=imagecreate(200,200); $maroon=imagecolorallocate($image,100,0,0); $white=imagecolorallocate($image,255,255,255); imagefilledrectangle($image,0,0,200,200,$white); imagerectangle($image,10,10,190,190,$maroon); imagefilledrectangle($image,50,50,150,150,$maroon); imagejpeg($image); imagedestroy($image); ?>imagegif($image);要用到最新的gd库,要生成gif请下载最新的gd库,用imagejpeg($image);代替旧可以了php.ini中去掉;extension=php_gd2.dll前面的分号 如下面代码<HTML><HEAD></HEAD><BODY><?PHP header("Content-type: image/gif");$image=imagecreate(200,200); $maroon=imagecolorallocate($image,100,0,0); $white=imagecolorallocate($image,255,255,255); imagefilledrectangle($image,0,0,200,200,$white); imagerectangle($image,10,10,190,190,$maroon); imagefilledrectangle($image,50,50,150,150,$maroon); imagejpeg($image); imagedestroy($image);?></BODY></HTML>可输出结果都为一大堆的乱七八糟代码晕怎么解决!再等几分钟就结贴! .....把HTML代码去掉啊!!!这样<?PHP header("Content-type: image/gif");$image=imagecreate(200,200); $maroon=imagecolorallocate($image,100,0,0); $white=imagecolorallocate($image,255,255,255); imagefilledrectangle($image,0,0,200,200,$white); imagerectangle($image,10,10,190,190,$maroon); imagefilledrectangle($image,50,50,150,150,$maroon); imagejpeg($image); imagedestroy($image);?> to surfchen :我知道那样可以,可是我想在一个<HTML>里的表<TABLE>中画一个动态的图这样,,我能控制页面的布局,如果加在页头,我不知道怎么控制页面的布局拉!帮忙解决一下谢过先! 画图的程序要单独在一个页面里面,不能和其他的程序混在一起的-------------aaaa.php----------<?PHPheader("Content-type: image/gif"); $image=imagecreate(200,200); $maroon=imagecolorallocate($image,100,0,0); $white=imagecolorallocate($image,255,255,255); imagefilledrectangle($image,0,0,200,200,$white); imagerectangle($image,10,10,190,190,$maroon); imagefilledrectangle($image,50,50,150,150,$maroon); imagejpeg($image); imagedestroy($image); ?>--------------index.html----------------------------下面是图片<image src=aaaa.php>上面是图片<hr>你运行index.html是不是看到图片了 to hahawen(变态的大龄青年) 有经验就是有经验一语道破,入木三分呀! 无限极分类 各位大大一起来帮忙看一下! 这样的参数是如何接受的? php如何获取这个javascript里的变量呢? {$var}是不是等于'$var'?什么时候要用到? 关于文件的包含 PHP的语音聊天系统 php初学者提问,请老鸟们指教啊! 超时的问题,请教大家!!! 请问高手:怎样将浏览的图片的地址插入数据库?? 关于文件写入...的问题 关于setcookie()与header()的问题
header("Content-type: image/gif");
$image=imagecreate(200,200);
$maroon=imagecolorallocate($image,100,0,0);
$white=imagecolorallocate($image,255,255,255);
imagefilledrectangle($image,0,0,200,200,$white);
imagerectangle($image,10,10,190,190,$maroon);
imagefilledrectangle($image,50,50,150,150,$maroon);
imagejpeg($image);
imagedestroy($image); ?>imagegif($image);要用到最新的gd库,要生成gif请下载最新的gd库,用imagejpeg($image);代替旧可以了
php.ini中去掉;extension=php_gd2.dll前面的分号
<HTML>
<HEAD></HEAD>
<BODY>
<?PHP header("Content-type: image/gif");
$image=imagecreate(200,200);
$maroon=imagecolorallocate($image,100,0,0);
$white=imagecolorallocate($image,255,255,255);
imagefilledrectangle($image,0,0,200,200,$white);
imagerectangle($image,10,10,190,190,$maroon);
imagefilledrectangle($image,50,50,150,150,$maroon);
imagejpeg($image);
imagedestroy($image);?>
</BODY>
</HTML>
可输出结果都为一大堆的乱七八糟代码晕怎么解决!
再等几分钟就结贴!
这样
<?PHP header("Content-type: image/gif");
$image=imagecreate(200,200);
$maroon=imagecolorallocate($image,100,0,0);
$white=imagecolorallocate($image,255,255,255);
imagefilledrectangle($image,0,0,200,200,$white);
imagerectangle($image,10,10,190,190,$maroon);
imagefilledrectangle($image,50,50,150,150,$maroon);
imagejpeg($image);
imagedestroy($image);?>
我知道那样可以,
可是我想在一个<HTML>里的表<TABLE>中画一个动态的图这样,,我能控制页面的布局,如果加在页头,我不知道怎么控制页面的布局拉!
帮忙解决一下谢过先!
<?PHP
header("Content-type: image/gif");
$image=imagecreate(200,200);
$maroon=imagecolorallocate($image,100,0,0);
$white=imagecolorallocate($image,255,255,255);
imagefilledrectangle($image,0,0,200,200,$white);
imagerectangle($image,10,10,190,190,$maroon);
imagefilledrectangle($image,50,50,150,150,$maroon);
imagejpeg($image);
imagedestroy($image); ?>--------------index.html----------------------------
下面是图片
<image src=aaaa.php>
上面是图片
<hr>
你运行index.html是不是看到图片了
有经验就是有经验一语道破,入木三分呀!