Miscellaneous

  Home arrow Miscellaneous arrow Page 2 - Adding Drop Shadows with PHP
MISCELLANEOUS

Adding Drop Shadows with PHP
By: bluephoenix
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2005-01-24

    Table of Contents:
  • Adding Drop Shadows with PHP
  • Setting the Shadow Options
  • Opening the Canvas
  • Allocating the Color Pallette
  • Drawing on the Canvas
  • Overlay the Original
  • Combined Code

  •  
     

    SEARCH CODEWALKERS

    Adding Drop Shadows with PHP - Setting the Shadow Options


    (Page 2 of 7 )

    Various factors can influence the appearance of the drop shadow. Some of these options can be defined as a set of constants at the beginning of our script to make our script more flexible. Changing them would affect the look of the drop shadow with little work in the future.

    <?php
    define
    ("DS_OFFSET"5);
    define("DS_STEPS"10);
    define("DS_SPREAD"1);
    ?>

    The DS_OFFSET constant represents the drop shadow's offset and will be used as the shadow's displacement distance from the top left corner from that of the original image. The DS_STEPS constant is the number of steps (or how many colors) that will be used when drawing the shadow to fade from black to the background color. The DS_SPREAD constant is the shadow's spread and affects how far one step should be from another.

    I've assigned them values I personally find reasonable; your situation or preferences may vary.

    More Miscellaneous Articles
    More By bluephoenix

    blog comments powered by Disqus

    MISCELLANEOUS ARTICLES

    - Attention: Forum and Site Maintenance
    - 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

    Developer Shed Affiliates

     



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