PHP: How to draw an image over another image?

前端 未结 2 1174
感动是毒
感动是毒 2020-12-11 08:19

I am using PHP & GD library.

I want to draw an image (say this one: http://www.gravatar.com/avatar/107f2fafb2d29fedc3783b141139a878?s=128&d=identicon&r=P

相关标签:
2条回答
  • 2020-12-11 08:24

    imagecopyresampled() or imagecopyresized() should do exactly what you want.
    (Despite its name, imagecopyresampled does resize as well.)
    They take some or all of the source image, resize it, and copy it into the destination image. If the source image isn't square, you can either crop or distort it as it is copied.

    0 讨论(0)
  • 2020-12-11 08:37

    imagecopy() or imagecopymerge(). It's documentation brings exemples too.

    0 讨论(0)
提交回复
热议问题