HomePHP Drawing More Complex Shapes with the GD Library in PHP
Drawing More Complex Shapes with the GD Library in PHP
The GD library that comes bundled with PHP 4 and PHP 5 provides web developers with a robust set of intuitive functions for generating and handling dynamic graphics with minor hassles. If you're interested in mastering the numerous features integrated with this PHP extension, this series of instructive tutorials will make the whole learning experience a truly painless process.
Welcome to the fourth part of the series that began with "A Close Look at the GD Library in PHP." This series introduces the most useful functions that come packaged with this powerful graphic PHP library. It also covers the utilization of the library from a practical point of view, since it includes numerous, easy-to-follow code samples.
So far, so good. Having introduced (at least basically) the topics covered by this series, and provided that you have already read its preceding articles, I'd like to spend a few moments summarizing the concepts that you hopefully learned so far concerning the use of the functions included with the GD extension.
In the previous article of the series, I showed you how to take advantage of the remarkable functionality of this PHP extension to display different types of basic arcs on the browser. I also covered outputting some basic characters. The GD functions that perform all of these drawing tasks are extremely simple to use, since most of them take a few intuitive input parameters to display the shapes.
It is this simplicity that makes the library very appealing for many PHP developers. Performing common tasks such as creating several image streams on the fly, or appending different text strings to an existing background picture, are all processes that can be achieved by utilizing a few straightforward functions.
All right, now that I have refreshed your memory of how to use the GD library to display distinct kinds of arcs on the browser, I believe that it's time to continue exploring many other handy functions that come integrated with this extension. Speaking more specifically, in this fourth tutorial of the series, I'll show you how to draw some additional shapes, such as filled arcs, and ellipses, along with creating dynamically different types of polygons and retrieving basic information about a given image stream.
With the preliminaries out of the way, let's learn together how to use the GD library to easily perform all of these tasks. It's going to be an educational experience, trust me!