ฟังก์ชัน imagedashline() วาดเส้นประ
ไวยากรณ์
imagedashedline( $image , $x1 , $y1 , $x2 , $y2 , $color )
พารามิเตอร์
-
ภาพ
สร้างภาพเปล่าด้วย imagecreatetruecolor() -
x1
พิกัด x บนซ้าย -
ปี1
พิกัด y บนซ้าย -
x2
พิกัด x ล่างขวา -
ปี2
พิกัด 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);
?> ผลลัพธ์
ต่อไปนี้เป็นผลลัพธ์:
