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