note 12110 deleted from function.imagedashedline by didou

From: Date: Fri, 15 Aug 2003 22:29:58 +0000
Subject: note 12110 deleted from function.imagedashedline by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54277@lists.php.net to get a copy of this message
Note Submitter: twan@ecreation.nl ---- 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);

« previous php.notes (#54277) next »