Functions
WebDev/*nix assorted functions & hacks
Search
find all
Array
-
Bash
-
Classes
-
Config
-
DateTime
-
Debug
-
dotjs
-
File
-
foooo
-
Git
-
HTML
-
Images
-
Javascript
-
Linux
-
Math
-
Misc
-
MySQL
-
OS X
-
Reading
-
Redis
-
Shell scripts
-
snippets
-
SQL
-
Strings
-
TextMate
-
Web
-
\(^o^)/ Fun!
-
_Misc hacks
-
_Pages
Images
filetypeMatchesExtension($file)
imagelinerectangle()
issa clock
rotate_wide_line($x, $y, $width, $length, $degrees)
4
found
auth
Name:
Category: Images
Body:
Apparently there's a bug somewhere between imagesetthickness and imagerectangle, yielding an extra pixel on the left and right sides of the drawn rectangle: http://php.net/manual/en/function.imagesetthickness.php#81741 (8 YEARS old at this time!) This does it better. // draw a $width-wide line AROUND the given coordinates, keeping in mind 0,0,1,1 yields a 2×2 square function imagelinerectangle($img, $x1, $y1, $x2, $y2, $color, $width=1) { imagefilledrectangle($img, $x1-$width, $y1-$width, $x2+$width, $y1-1, $color); imagefilledrectangle($img, $x2+1, $y1-$width, $x2+$width, $y2+$width, $color); imagefilledrectangle($img, $x1-$width, $y2+1, $x2+$width, $y2+$width, $color); imagefilledrectangle($img, $x1-$width, $y1-$width, $x1-1, $y2+$width, $color); }
Footer