Image "stitching" with GD - Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gojuka@si.rr.com

    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

  • Oli Filth

    #2
    Re: Image "stitching " with GD - Help

    gojuka@si.rr.co m said the following on 26/06/2005 16:12:[color=blue]
    > 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?
    >[/color]

    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

    Comment

    Working...