To create dynamic images in PHP we make use of GD Library. GD Library contains many functions to create and manipulate images.
For this to work make sure that you compile your PHP with GD Library. If you are using PHP on windows system then follow these steps.
1. Open php.ini file and search for "extension=php_gd2.dll"
2. Uncomment it by removing semicolon (;) from beginning of line.
3. Save it and close it.
4. Open ext (extension) directory it should be in folder where you installed PHP.
5. Make sure a file named “php_gd2.dll” exists; otherwise download it from PHP site.
6. Now restart you web server (IIS, Apache etc.)
7. Create a file named ellipse.php and copy paste code given below:
Now run this script in web browser, you will see:
One rectangles = Canvas of Image
One Ellipse = Ellipse drawing created by user.
If you have any doubt please post comment I will surely reply you
Have Fun!!!