- $ Im = imagecreate (200,150 );
- Echo $ im;
- ?>
- // Output
- Resource id #1
2. magecreatetruecolor-create a true-color canvas 1 in the format of imagecreatetruecolor (int x_size, int y_size) 2. resolution: create a blank canvas like imagecreate, the difference is that the canvas created by this function supports more colors, so the effect is better. the input canvas width and height pixel values return the ID number allocated to the canvas by the system. for example:
- $ Im = imagecreatetruecolor (200,150 );
- Echo $ im;
- ?>
- // Output
- Resource id #2
3. imagecreatefromgif-create a canvas and read an image in gif format to this canvas 1. Format: imagecreatefromgif (string filename) 2. resolution: the input parameter is the file name (path added) of a GIF image. If the image is in another format, an error is reported. The system returns the ID number assigned to the canvas for calling other drawing functions, for example:
- $ Im = imagecreatefromgif ('gd _ image/gif.gif ');
- Echo $ im;
- ?>
- // Output
- Resource id #3
IV. imagecreatefromjpeg-create a canvas and read a jpg image to this canvas 1. Format: imagecreatefromjpeg (string filename) 2. resolution: the input parameter is the name of a jpg image (with a path). If an image of another format is used, an error is reported. The system returns the ID number assigned to the canvas for calling other drawing functions, for example:
- $ Im = imagecreatefromjpeg ('gd _ image/gif.jpg ');
- Echo $ im;
- ?>
- // Output
- Resource id #4
5. imagecreatefrompng-create a canvas and read a png image to this canvas 1. Format: imagecreatefrompng (string filename) 2. resolution: the input parameter is the file name (path added) of a png image. If the image is in another format, an error is reported. The system returns the ID number assigned to the canvas, used to call other drawing functions, for example:
- $ Im = imagecreatefromgif ('gd _ image/gif.gif ');
- Echo $ im;
- ?>
- // Output
- Resource id #4
|