Drawing with GD Library
After 'Introduction to GD Library', We can start to know functions to draw line, rectangles, circles, arcs and strings.
To draw rectangle there are 2 functions:
- imagerectangle() creates a rectangle starting at the specified coordinates.
- imagefilledrectangle() creates a rectangle filled with color in the given image.
First example:
|
Code:
|
Result: |
Second example (filled):
|
Code:
|
Result: |
Draw a line:
Example:
|
Code:
|
Result: |
Draw a circle:
Example:
|
Code:
|
Result: |
Draw an arc:
Example:
|
Code:
|
Result: |
Draw a string:
Example:
|
Code:
|
Result: |
Fusion of all codes:
Example:
|
Code:
|
Result: |
For more information visit http://www.php.net/gd
