PHP Learning notes-----GD Library

Source: Internet
Author: User

use of the GD library in PHP

the latest The GD library version supports image files in GIF,JPEG,PNG,WBMP,XBM, and other formats.

Creating an image should complete the 4 steps shown below .

(1) creating a canvas

(2) drawing Images

(3) output Image

(4) Releasing Resources

Canvas Management

Imagecreate ()// Create a new palette-based image

Imagecreatetruecolor ()// Create a new true color image

Set color

Imagecolorallocate ()// assigning colors to an image

Generate images

Imagegif ()

Imagejpeg ()

Imagepng ()

Imagewbmp ()

Drawing an image

Imagefill ()// area fill

Imagesetpixel ()// Draw point

Imageline ()// Draw line

Imagerectangle ()// draw a rectangle

Imagefilledpolygon ()// Draw a polygon and fill

Imageellipse ()// draw an ellipse

Imagefilledellipse ()// Draw an ellipse and fill

Imagearc ()// Draw Elliptical Arc

Draw text

Imagestring ()// draw a line of string horizontally

Imagestringup ()// draw a line of string vertically

Imagechar ()// to draw a character horizontally

Imagecharup ()// to draw a character vertically

Imagettftext ()// Set Font

Picture Background Management

Imagecreatefromjpeg ()

Imagecreatefrompng ()

Imagecreatefromgif ()

GetImageSize ()

Picture copy

Imagecopyresampled ()// image can be scaled and trimmed

Imagecopy ()// watermark can be added

Picture rotation and rollover

Imagerotate ()


PHP Learning notes-----GD Library

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.