GD Library copy image to do watermark

Source: Internet
Author: User
Tags imagecopy

Copy a location from the copied source picture to the target picture, not resizing

Imagecopy (target picture canvas, copy source canvas, upper left corner of target canvas x, y, upper left corner of source canvas x, y, copy picture width, height);

Allow resizing

imagecopyresampled (target picture canvas, copy source canvas, upper left corner of target canvas x, y, upper left corner of source canvas x, y, width of target canvas, height, width of copy source picture, height);

You can set the transparency

Imagecopy (target picture canvas, copy source canvas, upper left corner of target canvas x, y, upper left corner of source canvas x, y, copy picture width, height, transparency 0-100);

<?php//Large picture cloth $im1=imagecreatefromjpeg ('./001.jpg ');//Small Picture cloth $im2=imagecreatefromjpeg ('./01.jpg ');//Copy the small image onto the larger image// Cannot resize Imagecopy ($im 1, $im 2,1000,0,0,0,329,220),//Can be resized imagecopyresampled ($im 1, $im 2,1000,220,0,0,329* 2,440,329,220);//adjust transparent figure imagecopymerge ($im 1, $im 2,500,0,0,0,329,220,40);//Output header (' content-type:image/jpeg; '); Imagejpeg ($im 1);//Destroy Canvas Imagedestroy ($im 1); Imagedestroy ($im 2);? >

GD Library copy image to do watermark

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.