homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Drawing boxes on an image
Fastest way?

 2:44 pm on Jan 14, 2008 (gmt 0)


I've got a 720x480 image that I'd like to draw some boxes on. At most, I want to draw 5400 boxes being 8x8 each. I've had a look at [uk2.php.net...] but it looks like you have to create a resource, draw the rect, save the resource and then start again.

I may be mistaken by the way! If not, what's the easiest way to say:

- Here's an image, copy it.
- Create 5400 8x8 boxes and set the coords for 8+n, etc...
- Apply those boxes
- Save



 4:09 pm on Jan 14, 2008 (gmt 0)

What’s about first drawing a line from top to bottom stating at 8px from top left corner.
Doing it in a loop and incrementing each iteration by 9px plus line thickness.

Then do the same across


 6:40 pm on Jan 14, 2008 (gmt 0)

Ah not, it's ok, I figured it out. I realised that imagefilledrectangle can be within a loop, so I can do exactly what I set out to do! Works a treat and is super fast!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved