Login Register Wishes Forum About
Language Reference » Drawing functions » drawGradientArea
Help topics
Latest updates
4693d  replaceImageMapTitle
4693d  replaceImageMapValues
4693d  createFunctionSerie
4693d  setAbsicssaPosition
4693d  negateValues
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
drawGradientArea - Rectangular gradient area

This function allows you to draw rectangular gradient areas. Most of the time, you‘ll use this function to build your image background. It is possible to tune the rendering by playing with the $Format array. To learn more about this please read the Format array guide. This functions are supporting anti-alias and shadows.

Calling this function
Where :

X1,Y1 are the start coordinate of the rectangle.
X2,Y2 are the end coordinate of the rectangle.
Format is an array containing the drawing parameters.

Customisation array - Tune up your gradient area!

It is possible to customize the rendering by playing with this array. Providing a detailled configuration is not mandatory, by default the gradient will be drawn with grey levels and no transparency.

The start color can be set with StartR, StartG, StartB.
The end color can be set with EndR, EndG, EndB.
The alpha transparency factor can be set with Alpha.
If Levels is specified, this will override the end colors by adding this value to the start colors. Levels can be either a positive or negative integer.

Sample script

 /* Left areas*/
 $GradientSettings = array("StartR"=>181,"StartG"=>209,"StartB"=>27,"Alpha"=>100,"Levels"=>-50);

 $GradientSettings = array("StartR"=>209,"StartG"=>134,"StartB"=>27,"Alpha"=>30,"Levels"=>-50);

  /* Right areas*/
 $GradientSettings = array("StartR"=>209,"StartG"=>31,"StartB"=>27,"Alpha"=>100,"Levels"=>50);

 $GradientSettings = array("StartR"=>209,"StartG"=>125,"StartB"=>27,"Alpha"=>100,"Levels"=>50);

 $GradientSettings = array("StartR"=>209,"StartG"=>198,"StartB"=>27,"Alpha"=>100,"Levels"=>50);

 $GradientSettings = array("StartR"=>134,"StartG"=>209,"StartB"=>27,"Alpha"=>100,"Levels"=>50);

This will draw 5 gradient areas with different directions and alpha factors.
Last updated on 10/13/2009 
by Jean-Damien 
Linked resources
Community comments
  No comments have been posted yet.
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 415 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.