, php manual pl (2) 

[ Pobierz całość w formacie PDF ]
.Toskip the filename argument in order to provide a quality argument just use an empty string ( ).Bysending an image/jpeg content-type using header(), you can create a PHP script that outputs JPEGimages directly.Notatka: JPEG support is only available if PHP was compiled against GD-1.8 or later.quality is optional, and ranges from 0 (worst quality, smaller file) to 100 (best quality, biggestfile).The default is the default IJG quality value (about 75).If you want to output Progressive JPEGs, you need to set interlacing on with imageinterlace().See also imagepng(), imagegif(), imagewbmp(), imageinterlace() and imagetypes().imageline (PHP 3, PHP 4 )Draw a lineint imageline ( resource image, int x1, int y1, int x2, int y2, int col) \linebreakimageline() draws a line fromx1,y1tox2,y2(top left is 0, 0) in image im of colorcol.See also imagecreate() and imagecolorallocate().imageloadfont (PHP 3, PHP 4 )Load a new fontint imageloadfont ( string file) \linebreakimageloadfont() loads a user-defined bitmap font and returns an identifier for the font (that is alwaysgreater than 5, so it will not conflict with the built-in fonts).The font file format is currently binary and architecture dependent.This means you should generatethe font files on the same type of CPU as the machine you are running PHP on.Tabela 1.Font file formatbyte position C data type descriptionbyte 0-3 int number of characters in the font710 Imagebyte position C data type descriptionbyte 4-7 int value of first character in thefont (often 32 for space)byte 8-11 int pixel width of each characterbyte 12-15 int pixel height of each characterbyte 16- char array with character data, onebyte per pixel in each character,for a total of(nchars*width*height) bytes.See also imagefontwidth() and imagefontheight().imagepalettecopy (PHP 4 >= 4.1)Copy the palette from one image to anotherint imagepalettecopy ( resource destination, resource source) \linebreakimagepalettecopy() copies the palette from thesourceimage to thedestinationimage.imagepng (PHP 3>= 3.13, PHP 4 )Output a PNG image to either the browser or a fileint imagepng ( resource image [, string filename]) \linebreakThe imagepng() outputs a GD image stream (image) in PNG format to standard output (usually thebrowser) or, if a filename is given by thefilenameit outputs the image to the file.See also imagegif(), imagewbmp(), imagejpeg(), imagetypes().imagepolygon (PHP 3, PHP 4 )Draw a polygonint imagepolygon ( resource image, array points, int num_points, int col) \linebreak711 Imageimagepolygon() creates a polygon in image id.pointsis a PHP array containing the polygon svertices, ie.points[0] = x0, points[1] = y0, points[2] = x1, points[3] = y1, etc.num_pointsis thetotal number of vertices.See also imagecreate().imagepsbbox (PHP 3>= 3.9, PHP 4 )Give the bounding box of a text rectangle using PostScript Type1 fontsarray imagepsbbox ( string text, int font, int size [, int space [, int tightness [, float angle]]]) \linebreakSizeis expressed in pixels.Spaceallows you to change the default value of a space in a font.This amount is added to thenormal value and can also be negative.Tightnessallows you to control the amount of white space between characters.This amount isadded to the normal character width and can also be negative.Angleis in degrees.Parametersspaceandtightnessare expressed in character space units, where 1 unit is1/1000th of an em-square.Parametersspace,tightness, andangleare optional.The bounding box is calculated using information available from character metrics, andunfortunately tends to differ slightly from the results achieved by actually rasterizing the text.If theangle is 0 degrees, you can expect the text to need 1 pixel more to every direction.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 imagepstext().imagepscopyfont (PHP 3>= 3.9, PHP 4 )Make a copy of an already loaded font for further modificationint imagepscopyfont ( int fontindex) \linebreakUse this function if you need make further modifications to the font, for exampleextending/condensing, slanting it or changing it s character encoding vector, but need to keep theoriginal along as well.Note that the font you want to copy must be one obtained usingimagepsloadfont(), not a font that is itself a copied one.You can although make modifications to itbefore copying.712 ImageIf you use this function, you must free the fonts obtained this way yourself and in reverse order.Otherwise your script will hang.In the case everything went right, a valid font index will be returned and can be used for furtherpurposes.Otherwise the function returnsFALSEand prints a message describing what went wrong.See also imagepsloadfont().imagepsencodefont (PHP 3>= 3.9, PHP 4 )Change the character encoding vector of a fontint imagepsencodefont ( int font_index, string encodingfile) \linebreakLoads a character encoding vector from from a file and changes the fonts encoding vector to it.As aPostScript fonts default vector lacks most of the character positions above 127, you ll definitely wantto change this if you use an other language than english.The exact format of this file is described inT1libs documentation.T1lib comes with two ready-to-use files, IsoLatin1.enc and IsoLatin2.enc.If you find yourself using this function all the time, a much better way to define the encoding is to setps.default_encoding in the configuration file to point to the right encoding file and all fonts you loadwill automatically have the right encoding.imagepsextendfont (PHP 3>= 3.9, PHP 4 )Extend or condense a fontbool imagepsextendfont ( int font_index, float extend) \linebreakExtend or condense a font (font_index), if the value of theextendparameter is less than oneyou will be condensing the font.imagepsfreefont (PHP 3>= 3.9, PHP 4 )Free memory used by a PostScript Type 1 fontvoid imagepsfreefont ( int fontindex) \linebreakSee also imagepsloadfont().imagepsloadfont (PHP 3>= 3.9, PHP 4 )Load a PostScript Type 1 font from fileint imagepsloadfont ( string filename) \linebreak713 ImageIn the case everything went right, a valid font index will be returned and can be used for furtherpurposes.Otherwise the function returnsFALSEand prints a message describing what went wrong,which you cannot read directly, while the output type is image.See also imagepsfreefont().imagepsslantfont (PHP 3>= 3.9, PHP 4 )Slant a fontbool imagepsslantfont ( int font_index, float slant) \linebreakSlant a font given by thefont_index parameter with a slant of the value of theslantparameter.imagepstext (PHP 3>= 3.9, PHP 4 )To draw a text string over an image using PostScript Type1 fontsarray imagepstext ( resource image, string text, int font, int size, int foreground, int background, int x, int y[, int space [, int tightness [, float angle [, int antialias_steps]]]]) \linebreakSizeis expressed in pixels.Foregroundis the color in which the text will be painted.Backgroundis the color to which thetext will try to fade in with antialiasing.No pixels with the colorbackgroundare actually painted,so the background image does not need to be of solid color.The coordinates given byx,y will define the origin (or reference point) of the first character(roughly the lower-left corner of the character).This is different from the imagestring(), wherex,ydefine the upper-right corner of the first character.Refer to PostScipt documentation about fonts andtheir measuring system if you have trouble understanding how this works.Spaceallows you to change the default value of a space in a font.This amount is added to thenormal value and can also be negative.714 ImageTightnessallows you to control the amount of white space between characters [ Pobierz całość w formacie PDF ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • anikol.xlx.pl