Welcome to WebmasterWorld Guest from 54.166.33.25

Forum Moderators: coopster & jatar k

Drawing boxes on an image

Fastest way?

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

WebmasterWorld Senior Member 10+ Year Member



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)

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



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)

WebmasterWorld Senior Member 10+ Year Member



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!
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month