PHP operation Image

Source: Internet
Author: User
Tags imagejpeg
PHP is indeed a simple language for operating images in PHP. PHP is so popular because it can implement functions with the simplest statements and discard too many complicated configurations, A few words can be used to implement functions that can be implemented by writing a bunch of JAVA; this is both a bit of a disadvantage, but in any case, PHP leads a trend that is simple, simple is all;

The easiest way to operate images in php is to add watermarks and texts to images;

1. add a watermark:

   

Imagejpeg ($ img, $ filename, qulity): this key method has three parameters: the first is the image object, the second is the image storage path, and the third is the image quality;

If it is displayed directly, enter only the first parameter. if it is saved as a file, enter the second parameter, such as D:/img/I .jpg, and save it;

2. Add text:

    

Imagefttext (resource $ image, float $ size, float $ angle, int $ x, int $ y, int $ col, string $ font_file, string $ text [, array $ extrainfo]): This function is the key

3. Generate the registration code:

   

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.