คำอธิบาย
ฟังก์ชัน imagedashedline() ใช้วาดเส้นประ
รูปแบบการใช้งาน (Syntax)
imagedashedline($image, $x1, $y1, $x2, $y2, $color)
พารามิเตอร์
image
สร้างภาพว่างด้วย imagecreatetruecolor()x1
พิกัด x มุมซ้ายบนy1
พิกัด y มุมซ้ายบนx2
พิกัด x มุมขวาล่างy2
พิกัด y มุมขวาล่างcolor
สีของเส้น
ค่าที่คืนกลับ
ฟังก์ชันคืนค่า 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);
?>
ผลลัพธ์
ภาพแสดงเส้นประบนพื้นหลังสี