note 62606 added to function.imageline

From: Date: Sat, 04 Mar 2006 22:41:48 +0000
Subject: note 62606 added to function.imageline
Groups: php.notes 
Request: Send a blank email to php-notes+get-104835@lists.php.net to get a copy of this message
This is a function to make a dotted line. It accepts (it actually requires) 7 parameters and returns 1 if everything went OK and 0 if there was a problem. int imagelinedotted ( resource im, int x1, int y1, int x2, int y2, int dist, int col ) imagelinedotted() draws a line from x1, y1 to x2, y2 (top left is 0, 0) in image im of colour col where dist defines the distance (measured in pixels) between one dot and another. <?php function imagelinedotted ($im, $x1, $y1, $x2, $y2, $dist, $col) { $transp = imagecolortransparent ($im); $style = array ($col); for ($i=0; $i<$dist; $i++) { array_push($style, $transp); // Generate style array - loop needed for customisable distance between the dots } imagesetstyle ($im, $style); return (integer) imageline ($im, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED); imagesetstyle ($im, array($col)); // Reset style - just in case... } ?> ---- Server IP: 212.124.37.9 Probable Submitter: 217.80.67.228 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.imageline.php Edit -- http://master.php.net/note/edit/62606 Del: integrated -- http://master.php.net/note/delete/62606/integrated Del: useless -- http://master.php.net/note/delete/62606/useless Del: bad code -- http://master.php.net/note/delete/62606/bad+code Del: spam -- http://master.php.net/note/delete/62606/spam Del: non-english -- http://master.php.net/note/delete/62606/non-english Del: in docs -- http://master.php.net/note/delete/62606/in+docs Del: other reasons-- http://master.php.net/note/delete/62606 Reject -- http://master.php.net/note/reject/62606 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#104835) next »