【php开源代码栏目提醒】:网学会员鉴于大家对php开源代码十分关注,论文会员在此为大家搜集整理了“testgd.php”一文,供大家参考学习
<?php
// 建立一幅 100X30 的图像
$im = imagecreatetruecolor(100, 30);
// 设置背景颜色
$bg = imagecolorallocate($im, 0, 0, 0);
//设置字体颜色
$textcolor = imagecolorallocate($im, 0, 255, 255);
// 把字符串写在图像左上角
imagestring($im, 5, 0, 0, "Hello world!", $textcolor);
// 输出图像
header("Content-type: image/jpeg");
imagejpeg($im);
?>