close

 

語法 : int imagedashedline (int im, int x1, int y1, int x2, int y2, int col)

說明 : ImageDashedLine( )在圖形 im中,從 x1,y1到 x2,y2畫一條顏色為 col的虛線。


<?php
$width = 204;
$height = 317;

$canvas = imagecreate($width, $height);

$white = imagecolorallocate($canvas, 255, 2555, 255);
$black = imagecolorallocate($canvas, 0, 0, 0);

$topLeft = 2;
$topRight = 2;

$bottomLeft = $width-2;
$bottomRight = $height-2;

imagesetthickness($canvas, 1);

// parallel line, solid
imageline($canvas, 0, 101, 204, 101, $black);

// parallel line, should be dashed, fail
imagedashedline($canvas, 0, 121, 204, 121, $black);

// parallel line should be dashed, works
imagedashedline($canvas, 0, 0, 204, 305, $black);

imagejpeg($canvas,'dashes.jpg');
imagedestroy($canvas)

?>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 stockwfj3 的頭像
    stockwfj3

    程式設計@筆記

    stockwfj3 發表在 痞客邦 留言(0) 人氣()