Allows php to process images in a simple way. For example, download the image processing Class Based on the gb library.

Source: Internet
Author: User

The design idea of this class draws on jQuery and uses the concatenation method to operate images, such: Copy codeThe Code is as follows: $ image = new UsaImage (array ('filepath' => 'image1.jpg '));
// The image overwrites an image. Parameters 2 and 3 are the x and y positions to be placed.
$ Image-> Overlap ("image99.gif", 10, 10)
// Overwrite the image at a relative position. The last parameter is the scaling ratio. The default value is 1.
-> Overlap2('image00.gif ', array ('right' => 23, 'bottom' => 50), 0.5)
// Scale the image, set the maximum width and height, and scale the image proportionally.
-> Scale3 (1, 300,300)
// Output to the screen. The program header is automatically added, and the type is jpg. IMAGETYPE_JPEG is the constant of the php gb library.
-> Write (IMAGETYPE_JPEG );

Effect:

For more methods, see the code remarks.

Download the code: usaimage.rar

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.