Free WebSchools.com

Google




Blog ForumsLive chat WebhostingLink TO UsSEO ToolsResources


HOME

PHP Introduction
Php Installation
PHP Basic Scripts
PHP variables
PHP operators
PHP Conditional statement
PHP functions
PHP Arrays

PHP Objects & classes
PHP with Forms
PHP Files
PHP With Database
PHP session
PHP cookies
PHP Regular Expressions
PHP Server Environment
PHP Graphics
PHP Advance

PHP Graphics



This chapter explores generating graphics using GD extension functions. but graphics pages costs in terms of CPU time.in most cases the flexiblity of the dynamic graphics is not worth that you pay in the load imposed on the server.The GD Library is integrated in PHP versions 4.3 and above. If you are using an older version of PHP, you will have to install the graphics support manually.




int imagefontheight ( int font )
Returns the pixel height of a character in the specified font.

int imagefontwidth ( int font )
Returns the pixel width of a character in font.

int imageloadfont ( string file )
imageloadfont() loads a user-defined bitmap font and returns an identifier for the font (that is always greater than 5, so it will not conflict with the built-in fonts). It returns FALSE in case of error.

imagecolorat -- Get the index of the color of a pixel returns the index of the color of the pixel at the specified location in the image specified by image. If PHP is compiled against GD library 2.0 or higher and the image is a truecolor image, this function returns the RGB value of that pixel as integer. Use bitshifting and masking to access the distinct red, green and blue component values: Example 1. Access distinct RGB values

example of bar chart

this program shows the graph of the student marks in maths.




for more information about the PHP Graphics visit http://us2.php.net/manual/en/function.imagecolorat.php