Jump to content

PHP image layers?

- - - - -

  • Please log in to reply
1 reply to this topic

#1
bbqroast

bbqroast

    Codecall Addict

  • Members
  • PipPipPipPipPipPipPip
  • 554 posts
  • Location:/etc/passwd
Hello,
In this situation I have two images that need to be layered together one is slightly larger than the other and both need to be centered- both of them are PNG files.
Is there a function you know of that can take two png files and paste them together, they will always have the same specs.
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
There are various merge functions, i.e. imagecopymerge that can perform this. You could retrieve the width of the overlaying image, cut this number in half, and apply it to the center point of the background image to have it centered. You could do the same with the height of the image for vertical centering.


PHP: imagecopymerge - Manual
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users