关于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网站调试 上传视频,转化成FLASH问题!~急!~~~~在线等!~~ JS中不能使用某些php函数? 终于升了一级---小乐子与大家同享,顺便散分,周五下班前结贴 怎样设置iis使asp与php都能运行? PHP4转PHP5时,关于类的问题 php可是实现下面的功能吗?不知如何传递数组或者字符串 jquery.form.js 提交不了数据,怎么回事啊.. 关于文件写入...的问题 关于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是不是看到图片了
有经验就是有经验一语道破,入木三分呀!