当前位置:首页> PHP教程> php基础
关键字
文章内容
php动态生成图片示例。。
 
 
修改时间:[2009/07/15 04:29]    阅读次数:[942]    发表者:[起缘]
 
<?php 
//建立图像
$height 200;
$width =200;
$im imagecreate($width,$height);
$white imagecolorallocate($im,255,255,255);
$black1 imagecolorallocate($im,0,0,0);
$black imagecolorallocate($im,255,255,255);

//在图上绘画
imagefill($im,0,0,$black1);
imageline($im,0,0,$width,$height,$white);
imagestring($im,4,50,150,"Sales",$white);

//输出图像
header("Content-type: image/png");
imagepng($im);

//清理
imagedestroy($im);
?> 


(非常全面的一个php技术网站, 有相当丰富的文章和源代码.)