Welcome to WebmasterWorld Guest from 23.20.10.127

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Drawing boxes on an image

Fastest way?

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 12, 2004
posts: 789
votes: 0


Hey,

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)

Senior Member from US 

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 19, 2003
posts: 4393
votes: 2


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 12, 2004
posts: 789
votes: 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!
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members