Chapter 2 image processing-PHP Tutorial

Source: Internet
Author: User
Chapter 4 process images. Learning points: 1. Creating Images 2. simple small cases in PHP5, it is much easier to process dynamic images than before. PHP5 contains the GD extension package in the php. ini file. you only need to remove the GD extension. Learning points:
1. create an image
2. simple small cases

In PHP5, processing of dynamic images is much easier than before. PHP5 contains GD extension in the php. ini file
Expand the package. you only need to remove the corresponding comments of the GD extension package to use it normally. The GD library contained in PHP5 is upgraded.
GD2 Library, which contains some useful JPG functions that support true color image processing.
Generally, generated images are stored in the PHP document format. However, you can insert HTML images to SRC.
To directly obtain dynamic images. For example, verification code, watermark, and thumbnail.

1. create an image

General process for creating images:
1) set the header to tell the browser the MIME type you want to generate.
2) create an image region based on which operations will be performed in the future.
3) fill the background in the blank image area.
4) draw the input text of the graphic outline on the background.
5). output the final image.
6) clear all resources.
7). call images on other pages.

Set the header to specify the MIME output type

 

Create a blank image area

 

Fill background in blank image area

 

Draw a graphical outline input text on the background

 

Output final image

 

Clear all resources

 

Images created by calling other pages

 

II. simple small cases

Simple verification code

 

Load existing images

 

Load existing system fonts

 

Image thumbnail

 

Note: This article is a video tutorial from Li Yanhui PHP. This article is intended for communication purposes only and cannot be used for commercial purposes. Otherwise, the consequences will be borne by you.

Step 1. Create Images 2. simple small cases in PHP5, it is much easier to process dynamic images than before. PHP5 contains the GD extension package in the php. ini file. you only need to remove the GD extension...

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.