【php开源代码栏目提醒】:网学会员php开源代码为您提供simplegraph.php参考,解决您在simplegraph.php学习中工作中的难题,参考学习。
<?php
// set up image
$height = 200;
$width = 200;
$im = ImageCreateTrueColor($width, $height);
$white = ImageColorAllocate ($im, 255, 255, 255);
$blue = ImageColorAllocate ($im, 0, 0, 64);
// draw on image
ImageFill($im, 0, 0, $blue);
ImageLine($im, 0, 0, $width, $height, $white);
ImageString($im, 4, 50, 150, 'Sales', $white);
// output image
Header ('Content-type: image/png');
ImagePng ($im);
// clean up
ImageDestroy($im);
?>