note 61303 added to function.imagerectangle

From: Date: Mon, 30 Jan 2006 22:25:27 +0000
Subject: note 61303 added to function.imagerectangle
Groups: php.notes 
Request: Send a blank email to php-notes+get-102748@lists.php.net to get a copy of this message
Lets not do it Mr Benson's way OK! I'm sure if I had to draw a 10x10 grid on paper I wouldn't do it by drawing 100 individual squares, redrawing nearly half of the lines twice. I'd probably do it by drawing 11 vertical lines and 11 horizontal lines. function ImageGrid2(&$im,$startx,$starty,$width,$height,$xcols,$yrows,&$color) { $endy = $starty + $height * $yrows; for ( $x=0; $x <= $xcols; $x++ ) { $x1 = $startx + $width * $x; imageline ( $im, $x1, $starty, $x1, $endy, $color ); } $endx = $startx + $width * $xcols; for ( $y=0; $y <= $yrows; $y++ ) { $y1 = $starty + $height * $y; imageline ( $im, $startx, $y1, $endx, $y1, $color ); } } ---- Server IP: 85.116.0.130 Probable Submitter: 195.137.31.91 ---- Manual Page -- http://www.php.net/manual/en/function.imagerectangle.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61303 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61303&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61303&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61303&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61303&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61303&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61303&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61303&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61303&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102748) next »