Miscellaneous

  Home arrow Miscellaneous arrow Page 3 - An Intro to Using the GD Image Library...
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 / 5
    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

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    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

    blog comments powered by Disqus

    MISCELLANEOUS ARTICLES

    - Oracle Database XE: Indexes and Sequences
    - Modifying Tables in Oracle Database XE
    - Oracle Database XE: Tables and Constraints
    - More on Oracle Databases and Datatypes
    - Oracle Database XE Datatypes: Datetime and L...
    - Oracle Database XE Datatypes: Character and ...
    - From Databases to Datatypes
    - Firefox 3.6.6 Released with Improved Plug-in...
    - Attention Bloggers: WordPress 3.0 Now Releas...
    - Reflection in PHP 5
    - Inheritance and Other Advanced OOP Features
    - Advanced OOP Features
    - Linux from Scratch V.6.6 Review
    - Linux Gaining in Strength
    - Install Slackware on Your Old PC


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap