php第4章 数 据 处 理.pptVIP

  • 6
  • 0
  • 约6.29万字
  • 约 156页
  • 2020-11-04 发布于湖北
  • 举报
运行结果如图4.9所示。 图4.9 画五边形 2. 输出文本 (1)输出一个字符 使用imagechar()函数可以在图形上水平输出一个字符,语法格式如下: bool imagechar(resource $image, int $font, int $x, int $y, string $c, int $color) 例如: imagechar($image,5,50,50, C,$color); imageup()函数可以垂直地输出一个字符,用法与imagechar()函数相同。 (2)输出字符串 使用imagestring()函数可以在已经创建的背景图形上输出字符串,语法格式如下: bool imagestring(resource $image, int $font, int $x , int $y, string $s, int $color) 例如: ?php $image = imagecreate(100, 30); //建立一幅100×30的图像 $bg = imagecolorallocate($image, 255, 255, 255); //定义白色背景 $textcolor = imagecolorallocate($image, 0, 0, 255); //定义蓝色文本 imagestring($image, 5, 0, 0

文档评论(0)

1亿VIP精品文档

相关文档