最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php imagefilledrectangle在图片画一矩形并填充
时间:2022-06-24 20:11:33 编辑:袖梨 来源:一聚教程网
//发送头文件
header("content-type: image/png");
//创建真彩色图像
$im=imagecreatetruecolor(100,50);
//定义黑色
$black=imagecolorallocate($im,0,0,0);
//定义白色
$white=imagecolorallocate($im,255,255,255);
//画一矩形并填充
imagefilledrectangle($im,0,0,99,49, $white);
//定义字体
imagestring($im,2,0,0,"hello",$black);
//输出图像
imagepng($im);
/*
执行该代码将生成一幅png图像,并在图像上显示hello。
语法: int imagefilledrectangle(int im, int x1, int y1, int x2, int y2, int col);
返回值: 整数
函数种类: 图形处理
内容说明
本函数将图片的封闭长方形区域着色。参数 x1、y1 及 x2、y2 分别为矩形对角线的坐标。参数 col 表示欲涂上的颜色。
相关文章
- 鹅鸭杀超级金水铃模式怎么玩 08-07
- 牧场物语风之繁华集市生日日期怎么看 08-07
- 口袋新旅途如何捕捉颓颓鹰 08-07
- DNF狄瑞吉版本女漫游加点攻略 08-07
- 鹅鸭杀士兵怎么玩 08-07
- DNF狄瑞吉版本协战师加点攻略 08-07