XMPP JavaScript Library READ MORE

Creating dynamic ellipse image in php

PHP, Sachin Puri, 2010-04-25 22:02:47

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!!!

Note: If you want to include this image in your web page then write this code in you web page <img src="ellipse.php"/>. In same way you can create other shapes also like ARC,Rectangle,Polygon, etc.
Add Your Comment
    Yes! I want to receive all comments by email

No Comments Posted Yet. Be the first one to post comment