Miscellaneous
  Home arrow Miscellaneous arrow Page 3 - An Intro to Using the GD Image Library with PHP
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Forums Sitemap 
Dedicated Servers  
Download TestComplete 
JMSL Numerical Library 
IBM® developerWorks
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS

An Intro to Using the GD Image Library with PHP
By: Matt Wade
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2002-01-25

    Table of Contents:
  • An Intro to Using the GD Image Library with PHP
  • Getting to Know the Functions
  • More Functions
  • And Even More Functions
  • Putting It All Together
  • Let's Finish It Up

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    An Intro to Using the GD Image Library with PHP - More Functions


    (Page 3 of 6 )

    int ImageFilledEllipse (resource im, int cx, int cy, int w, int h, int col)

    With ImageFilledEllipse, we can create filled ellipses, or ovals and circles. We pass it the pointer to the image we are working on, a center point designated by cx and cy, its width and height and a color we have created.

    int ImageFilledArc (int im, int cx, int cy, int w, int h, 
    int s, int e, int col, int style)

    This function is a bit more complicated, but still not hard to use at all. Just think of it as cutting a piece of pie or cake. You pass it the image you are working on, a center point (think the middle of the pie) represented by cx and cy, its width and height, its start and end points in degrees (we'll touch on this in a second), a color you have created and its style (we'll also touch on this).

    To visualize the start and end points, let's think of our pie again. Let's say we are really hungry and want to cut ourselves a piece of pie that is 1/4 of the entire pie. We would pass the function a start point of 0 degrees and an end point of 90 degrees. There are 360 degrees in a circle, so a total on 90 degrees would be one fourth of it. You can vary the start and end degrees to decide "where" your piece of the pie comes from.

    With the style of the arc you can do some pretty cool stuff. There are four styles: IMG_ARC_PIE IMG_ARC_CHORD IMG_ARC_NOFILL IMG_ARC_EDGED. Using IMG_ARC_PIE is going to give you your traditional pie piece. The IMG_ARC_CHORD style produces a flat outer edge, rather than the traditional pie piece shape. With IMG_ARC_CHORD, you can make things like hexagons and other flat sided designs just by filling a circle with them. IMG_ARC_NOFILL tells the function not to fill the arc and IMG_ARC_EDGED tells it to connect up all the lines and have a border. If you need to use more than one of these, use the OR bitwise operator. I.e., IMG_ARC_CHORD | IMG_ARC_NOFILL.

    More Miscellaneous Articles
    More By Matt Wade


       · I've created a function that resizes an image and displays it in the browser or at...
       · Have you tried sending headers from the script anyway? If it's a separate script...
     

    MISCELLANEOUS ARTICLES

    - Stopping CSRF Attacks in Your PHP Applicatio...
    - Quick and Dirty AJAX Tutorial
    - Flickr Puzzle Mashup
    - The PAVISE of Security
    - Creating a CAPTCHA with PHP
    - Sending SMS Thru HTTP
    - The Postal Fix - Part 2
    - Adding Mail with Exim
    - The Postal Fix - Part 1
    - Create Your Own Custom API
    - Adding Drop Shadows with PHP
    - Writing a Basic Authentication System in PHP
    - Overlapping Images with GD
    - Using Sockets in PHP
    - Dynamic CSS with PHP






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway