(PHP 3, PHP 4 ) ImageDashedLine -- Draw a dashed line Descriptionint imagedashedline (int im, int x1, int y1, int x2, int y2, int col)
ImageDashedLine() draws a dashed line from
x1, y1 to
x2, y2 (top left is
0, 0) in image im of color
col.
See also ImageLine().
| User Contributed Notes: ImageDashedLine |
twan@ecreation.nl
22-Mar-2001 01:14 |
If you want to create dotted lines instead of dashed, use these functions:
function horizontalDottedLine($im, $x1, $x2, $y)
{
$color= ImageColorAllocate($im, 0, 0, 0);
$x_cur = $x1;
while ($x_cur <= $x2)
{
ImageSetPixel($im, $x_cur, $y, $color);
$x_cur += 2;
}
return $im;
}
function verticalDottedLine($im, $y1, $y2, $x)
{
$color= ImageColorAllocate($im, 0, 0, 0);
$y_cur = $y1;
while ($y_cur <= $y2)
{
ImageSetPixel($im, $x, $y_cur, $color);
$y_cur += 2;
}
return $im;
}
These functions both return an image identifier, so use it as follows:
$im = imageDottedLine($im, 1, 100, 50);
|
|
|