note 19558 deleted from function.imagerectangle by didou

From: Date: Tue, 19 Aug 2003 11:39:56 +0000
Subject: note 19558 deleted from function.imagerectangle by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54652@lists.php.net to get a copy of this message
Note Submitter: carl.luvs.spam@strategySPAMMEforward.com ---- The behavior of Image*Rectangle() seems undefined wrt the pixels that are actually effected, as are the underlying GD calls. They seem to treat the width,height as relative coordinates to which the pen travels, rather than as the defining limits of the box. For example: $width=100; $height=100; $image = ImageCreate($width, $height); $black = ImageColorAllocate($image, 0, 0, 0); $white = ImageColorAllocate($image, 255, 255, 255); ImageFilledRectangle($image, 0, 0, $width, $height, $white); ImageRectangle($image, 0, 0, $width, $height, $black); header("Content-type: image/png"); ImagePNG($image); ImageDestroy($image); will only show the top and left sides of the black rectangle. This can be a hassle, but not insurmountable. You just have to subtract 1 to get the "other" behavior. I don't have GD 2.0,but maybe someone who does can check to see how line thickness impacts this. Hopefully, it follows the pattern (filling pixels from $x+$width to $x+$width+$penwidth). Carl

« previous php.notes (#54652) next »