Home >Backend Development >PHP Tutorial >How to create images based on php gd library
Second, imagecreatetruecolor - Create a true color canvas 1. Format: imagecreatetruecolor (int x_size, int y_size) 2. Analysis: Like imagecreate, create a blank canvas. The difference is that the canvas created by this function supports more colors, so the effect is better. Pass in the pixel values of the width and height of the canvas, and return the pixel values assigned to this by the system. The id number of the block canvas, for example:
Three, imagecreatefromgif - Create A canvas and read a gif format picture into this canvas 1. Format: imagecreatefromgif (string filename) 2. Analysis: The parameter passed in is the file name (plus path) of a gif image. If the image is in other formats, an error will be reported. What is returned is the ID number assigned to this canvas by the system, which can be used for other drawings. Function calls, for example:
Four, imagecreatefromjpeg - Create a canvas and read a jpg format image into the canvas 1. Format: imagecreatefromjpeg (string filename) 2. Analysis: The parameter passed in is the file name of a jpg picture (plus path). If the picture is in other formats, an error will be reported. What is returned is the ID number assigned to this canvas by the system, which can be used for other drawings. Function calls, for example:
Five, imagecreatefrompng - Create a canvas and read a png format picture into this canvas 1. Format: imagecreatefrompng (string filename) 2. Analysis: The parameter passed in is the file name of a png picture (plus path). If the picture is in other formats, an error will be reported. What is returned is the ID number assigned to this canvas by the system, which can be used for other drawings. Function calls, for example:
|