471,596 Members | 948 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,596 software developers and data experts.

Image "stitching" with GD - Help

Hi All

I have (what seems to be) a rather simple problem I'd like to solve
using PHP with the GD library installed. I would like to "stitch"
multiple images together so that they appear next to each other, but
create a new file while doing this. For example, lets say I have 5
images named 1.gif through 5.gif, each containing the digits 1-5
respectively. I would like use GD to place them next to each other in
a new image (1 single image), so they read "12345" when displayed in
the browser. I do not want to have the 5 images simply displayed next
to each other.

Can this be done with GD?

TIA
Rob

Jul 17 '05 #1
1 2931
go****@si.rr.com said the following on 26/06/2005 16:12:
Hi All

I have (what seems to be) a rather simple problem I'd like to solve
using PHP with the GD library installed. I would like to "stitch"
multiple images together so that they appear next to each other, but
create a new file while doing this. For example, lets say I have 5
images named 1.gif through 5.gif, each containing the digits 1-5
respectively. I would like use GD to place them next to each other in
a new image (1 single image), so they read "12345" when displayed in
the browser. I do not want to have the 5 images simply displayed next
to each other.

Can this be done with GD?


Yes.

Create a blank image using createtruecolor() with dimensions big enough
to fit all five sub-images.

Then simply run imagecopy() five times, specifiying the new image as
destination every time, and each of sub-images in turn as source, and
calculate the position of the top-left corner in the destination image
each time.

--
Oli
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.