[ Pobierz całość w formacie PDF ]
.Angleis in degrees.Antialias_stepsallows you to control the number of colours used for antialiasing text.Allowed values are 4 and 16.The higher value is recommended for text sizes lower than 20, wherethe effect in text quality is quite visible.With bigger sizes, use 4.It s less computationally intensive.Parametersspaceandtightnessare expressed in character space units, where 1 unit is1/1000th of an em-square.Parametersspace,tightness,angleandantialiasare optional.This function returns an array containing the following elements:0 lower left x-coordinate1 lower left y-coordinate2 upper right x-coordinate3 upper right y-coordinateSee also imagepsbbox().imagerectangle (PHP 3, PHP 4 )Draw a rectangleint imagerectangle ( resource image, int x1, int y1, int x2, int y2, int col) \linebreakimagerectangle() creates a rectangle of color col in imageimagestarting at upper left coordinatex1, y1 and ending at bottom right coordinate x2, y2.0, 0 is the top left corner of the image.imagesetbrush (PHP 4 >= 4.6)Set the brush image for line drawingint imagesetbrush ( resource image, resource brush) \linebreakimagesetbrush() sets the brush image to be used by all line drawing functions (such as imageline()and imagepolygon()) when drawing with the special colorsIMG_COLOR_BRUSHEDorIMG_COLOR_STYLEDBRUSHED.Notatka: You need not take special action when you are finished with a brush, but if you destroythe brush image, you must not use the IMG_COLOR_BRUSHED or IMG_COLOR_STYLEDBRUSHEDcolors until you have set a new brush image!Notatka: This function was added in PHP 4.6715Imageimagesetpixel (PHP 3, PHP 4 )Set a single pixelint imagesetpixel ( resource image, int x, int y, int col) \linebreakimagesetpixel() draws a pixel atx,y (top left is 0, 0) in imageimageof colorcol.See also imagecreate() and imagecolorallocate().imagesetstyle (PHP 4 >= 4.6)Set the style for line drawingint imagesetstyle ( resource image, array style) \linebreakimagesetstyle() sets the style to be used by all line drawing functions (such as imageline() andimagepolygon()) when drawing with the special colorIMG_COLOR_STYLEDor lines of images withcolorIMG_COLOR_STYLEDBRUSHED.Thestyleparameter is an array of pixels.Following example script draws a dashed line fromupper left to lower right corner of the canvas:Przykład 1.imagesetstyleSee also imagesetbrush(), imageline().716ImageNotatka: This function was added in PHP 4.6imagesetthickness (PHP 4 >= 4.6)Set the thickness for line drawingvoid imagesetthickness ( resource image, int thickness) \linebreakimagesetthickness() sets the thickness of the lines drawn when drawing rectangles, polygons,ellipses etc.etc.tothicknesspixels.Notatka: This function was added in PHP 4.6 and requires GD 2.1 or laterimagesettile (PHP 4 >= 4.6)Set the tile image for fillingint imagesettile ( resource image, resource tile) \linebreakimagesettile() sets the tile image to be used by all region filling functions (such as imagefill() andimagefilledpolygon()) when filling with the special colorIMG_COLOR_TILED.A tile is an image used to fill an area with a repeated pattern.Any GD image can be used as a tile,and by setting the transparent color index of the tile image with imagecolortransparent(), a tileallows certain parts of the underlying area to shine through can be created.Notatka: You need not take special action when you are finished with a tile, but if you destroy thetile image, you must not use the IMG_COLOR_TILED color until you have set a new tile image!Notatka: This function was added in PHP 4.6imagestring (PHP 3, PHP 4 )Draw a string horizontallyint imagestring ( resource image, int font, int x, int y, string s, int col) \linebreakimagestring() draws the stringsin the image identified byimageat coordinatesx,y (top left is 0,0) in colorcol.If font is 1, 2, 3, 4 or 5, a built-in font is used.See also imageloadfont().717Imageimagestringup (PHP 3, PHP 4 )Draw a string verticallyint imagestringup ( resource image, int font, int x, int y, string s, int col) \linebreakimagestringup() draws the stringsvertically in the image identified byimageat coordinatesx,y(top left is 0, 0) in colorcol.If font is 1, 2, 3, 4 or 5, a built-in font is used.See also imageloadfont().imagesx (PHP 3, PHP 4 )Get image widthint imagesx ( resource image) \linebreakimagesx() returns the width of the image identified byimage.See also imagecreate() and imagesy().imagesy (PHP 3, PHP 4 )Get image heightint imagesy ( resource image) \linebreakimagesy() returns the height of the image identified byimage.See also imagecreate() and imagesx().imagetruecolortopalette (PHP 4 >= 4.6)Convert a true color image to a palette imagevoid imagetruecolortopalette ( resource image, bool dither, int ncolors) \linebreakimagetruecolortopalette() converts a truecolor image to a palette image.The code for this functionwas originally drawn from the Independent JPEG Group library code, which is excellent.The codehas been modified to preserve as much alpha channel information as possible in the resulting palette,in addition to preserving colors as well as possible.This does not work as well as might be hoped.Itis usually best to simply produce a truecolor output image instead, which guarantees the highestoutput quality.ditherindicates if the image should be dithered - if it isTRUEthen dithering will be used whichwill result in a more speckled image but with better color approximation.ncolorssets the maximum number of colors that should be retained in the palette.Notatka: This function was added in PHP 4.6 and requires GD 2.1 or later718Imageimagettfbbox (PHP 3>= 3.1, PHP 4 )Give the bounding box of a text using TrueType fontsarray imagettfbbox ( int size, int angle, string fontfile, string text) \linebreakThis function calculates and returns the bounding box in pixels for a TrueType text.textThe string to be measured.sizeThe font size in pixels.fontfileThe name of the TrueType font file.(Can also be an URL.) Depending on which version of theGD library that PHP is using, it may attempt to search for files that do not begin with a leading / by appending .ttf to the filename and searching along a library-defined font path.angleAngle in degrees in whichtextwill be measured.imagettfbbox() returns an array with 8 elements representing four points making the bounding boxof the text:0 lower left corner, X position1 lower left corner, Y position2 lower right corner, X position3 lower right corner, Y position4 upper right corner, X position5 upper right corner, Y position6 upper left corner, X position7 upper left corner, Y positionThe points are relative to the text regardless of the angle, so "upper left" means in the top left-handcorner seeing the text horizontallty.This function requires both the GD library and the FreeType library.See also imagettftext().imagettftext (PHP 3, PHP 4 )Write text to the image using TrueType fonts719Imagearray imagettftext ( resource image, int size, int angle, int x, int y, int col, string fontfile, string text) \line-breakimagettftext() draws the stringtextin the image identified byimage, starting at coordinatesx,y(top left is 0, 0), at an angle ofanglein colorcol, using the TrueType font file identified byfontfile.Depending on which version of the GD library that PHP is using, whenfontfiledoes not begin with a leading / , .ttf will be appended to the filename and the the library willattempt to search for that filename along a library-defined font path.The coordinates given byx,y will define the basepoint of the first character (roughly the lower-leftcorner of the character).This is different from the imagestring(), where x, y define the upper-rightcorner of the first character
[ Pobierz całość w formacie PDF ]