Home > Backend Development > PHP Tutorial > Overview of PHP GD library functions_PHP tutorial

Overview of PHP GD library functions_PHP tutorial

WBOY
Release: 2016-07-15 13:33:38
Original
1201 people have browsed it

We are using

GetImageSize
Function: Get the size of the image [i.e. length and width]
PHP GD library function usage: array GetImageSize(string filename, array [imageinfo]);

ImageArc
Function: draw arc
Usage: int ImageArc(int im, int cx, int cy, int w, int h, int s, int e, int col);

ImageChar
Function: write horizontal characters
PHP GD library function usage: int ImageChar(int im, int font, int x, int y, string c, int col);

ImageCharUp
Function: Write vertical characters
Usage: int ImageCharup(int im, int font, int x, int y, string c, int col);

ImageColorAllocate
Function: Match colors
PHP GD library function usage: int ImageColorAllocate(int im, int red, int green, int blue);

ImageColorTransparent
Function: Specify transparency Background color
Usage: int ImageColorTransparent(int im, int [col]);

ImageCopyResized
Function: Copy new image and resize
PHP GD library function usage: int ImageCopyResized(int dst_im, int src_im, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH);

ImageCreate
Function: Create a new image
Usage: int ImageCreate(int x_size, int y_size);

ImageDashedLine
Function: Draw a dotted line
Usage: int ImageDashedLine(int im, int x1, int y1, int x2, int y2, int col) ;

ImageDestroy
PHP GD library function function: end graphics
Usage explanation: int ImageDestroy(int im);

ImageFill
Function: graphics coloring
Usage :int ImageFill(int im, int x, int y, int col);

ImageFilledPolygon
Function: polygon area coloring
PHP GD library function usage: int ImageFilledPolygon(int im, array points, int num_points, int col);

ImageFilledRectangle
Function: Rectangular area coloring
Usage: int ImageFilledRectangle(int im, int x1, int y1, int x2, int y2, int col);

ImageFillToBorder
Function: Coloring within the specified color area
PHP GD library function usage: int ImageFillToBorder(int im, int x, int y, int border, int col);

ImageFontHeight
Function: Get the height of the font
Usage: int ImageFontHeight(int font);

ImageFontWidth
Function: Get the width of the font
Usage: int ImageFontWidth(int font ; >Function: Draw a solid line

Usage: int ImageLine(int im, int x1, int y1, int x2, int y2, int col);


ImageLoadFont
Function: Load bitmap fonts Type

Usage: int ImageLoadFont(string file);


ImagePolygon
Function: draw polygons

Usage: int ImagePolygon(int im, array points, int num_points, int col);


ImageRectangle
Function: Draw a rectangle

Usage: int ImageRectangle(int im, int x1, int y1, int x2, int y2, int col);


ImageSetPixel
Function : Draw points

PHP GD library function usage: int ImageSetPixel(int im, int x, int y, int col);


ImageString
Function: Draw horizontal string

Usage: int ImageString(int im, int font, int x, int y, string s, int col);


ImageStringUp
Function: Draw a straight string

Usage: int ImageStringUp(int im, int font, int x, int y, string s, int col);


ImageSX
Function: Get the width of the image

Usage: int ImageSX(int im);


ImageSY
Function: Get the height of the image

PHP GD library function usage: int ImageSY(int im);


ImageTTFBBox
Function: Calculate the area occupied by TTF text

Usage: array ImageTTFBBox(int ​​size, int angle, string fontfile, string text);


ImageTTFText
Function: Write TTF text into the image

Usage: array ImageTTFText(int im, int size, int angle, int x, int y, int col, string fontfile, string text);


ImageColorAt
Function: Get the index value of the color of the specified point in the picture

Usage: int ImageColorAt(int im, int x , int y);


ImageColorClosest
Function: Calculate the closest color to the specified color in the color table

PHP GD library function usage: int ImageColorClosest(int im, int red, int green, int blue );


ImageColorExact
Function: Calculate the specified color index value on the color table

Usage: int ImageColorExact(int im, int red, int green, int blue);


ImageColorResolve
Function: Calculate the index value of the specified or closest color on the color table

Usage: int ImageColorResolve(int im, int red, int green, int blue);


ImageColorSet
Function: Set the color of the specified index on the color table

Usage: boolean ImageColorSet(int im, int index, int red, int green, int blue);


ImageColorsForIndex
Function: Get the specified color table Indexed colors

PHP GD library function usage: array ImageColorsForIndex(int ​​im, int index);


ImageColorsTotal
Function: Calculate the number of colors in the image

Usage: int ImageColorsTotal(int im) ;


ImagePSLoadFont
Function: Load PostScript font

Usage: int ImagePSLoadFont(string filename);


ImagePSFreeFont
Function: Unload PostScript font

Usage: void ImagePSFreeFont(int fontindex);

ImagePSEncodeFont
Function: Convert PostScript fonts into vector words
PHP GD library function usage: int ImagePSEncodeFont(string encodingfile);

ImagePSText
Function: Write PostScript text into the image
Usage: array ImagePSText(int image, string text, int font, int size, int foreground, int background, int x, int y, int space, int tightness, float angle, int antialias_steps);

ImagePSBBox
Function: Calculate the area occupied by PostScript text
PHP GD library function usage: array ImagePSBBox(string text, int font, int size, int space, int width, float angle);

ImageCreateFromPNG
Function: Take out PNG graphics
Usage: int ImageCreateFromPng(string filename);

ImagePNG
Function: Create PNG graphics
Usage: int ImagePng(int im, string [filename]);

ImageCreateFromGIF
Function: Take out GIF graphics
Usage: int ImageCreateFromGif(string filename);

ImageGIF
Function: Create GIF graphics
PHP GD library function usage: int ImageGif(int im, string [filename]);


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446047.htmlTechArticleWe are using GetImageSize Function: Get the size of the image [i.e. length and width] PHP GD library function usage: array GetImageSize (string filename, array [imageinfo]); ImageArc Function: Use to draw arcs...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template