Thread: Dynamic Image
View Single Post
Old October 8th, 2003, 02:10 AM
nikolai nikolai is offline
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts

This really isn't a PHP issue as much as it is a mathematics issue. I'm assuming that the cut pieces are all similar to each other -- that is, they're all the same shape, all angles are the same, all curves are the same, and the ratio of all lenths are the same.

That said, the image generating function doesn't really need to generate a new image for every size, but needs to calculate the new lengths to be cut to make the same design.

So that means that if your Medium size is 10% larger than your small size, then all your curves and angles are the same, and all your sides are 10% longer.

You can use the same cutout base image and just generate new length text onto that image using the gd image creation and manipulation library extension.

Take care,