PHP 中的 imagedashedline() 函数
imagedashedline() 函数绘制虚线。
语法
imagedashedline( $image , $x1 , $y1 , $x2 , $y2 , $color )
参数
图像
使用 imagecreatetruecolor() 创建空白图像。x1
左上角 x 坐标y1
左上角 y 坐标x2
右下角 x 坐标y2
右下角 y 坐标颜色
填充颜色。
返回值
成功时函数返回 TRUE,失败时返回 FALSE。
示例
以下是一个示例
<?php
$image = imagecreatetruecolor(500, 370);
$bgcolor = imagecolorallocate($image, 70, 90, 120);
imagefill($image, 0, 0, $bgcolor);
$color = imagecolorallocate($image, 90, 220, 175);
imagedashedline($image, 0, 0, 150, 50, $color);
header("Content-type: image/png");
imagepng($image);
?>输出
以下为输出

广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP