GOA - System.Drawing.Filters.GradientGlowFilter

GradientGlowFilter Class


Represents a filter which adds a Gradient color frame to the VisualElement it is applied on.

Definition

public class GradientGlowFilter: Filter

Members Table

MethodDescription
CloneCreates a shallow copy of the current Filter. (Inherited from Filter)
CopyGradientCopies the gradient of the current GradientGlowFilter to another Gradient.
EqualsOverloaded. Compares two objects to determine if they are equal. (Inherited from Object)
GetHashCodeServes as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object)
GetTypeGets the Type of the current instance. (Inherited from Object)
GradientGlowFilterInitializes a new instance of GradientGlowFilter.
ReferenceEqualsDetermines whether the specified Object instances are the same instance. (Inherited from Object)
SetGradientSets a specified Gradient to the GradientGlowFilter.
ToStringReturns a String that represents the current Object. (Inherited from Object)
PropertyDescription
AngleGets or sets the angle to apply to the GradientGlowFilter.
BlurXGets or sets the level of blurring of the GradientGlowFilter horizontally.
BlurYGets or sets the level of blurring of the GradientGlowFilter vertically.
DistanceGets or sets the distance of the GradientGlowFilter from the background.
GlowTypeGets or sets the type of the GradientGlowFilter.
KnockoutGets or sets a value indicating whether the GradientGlowFilter has to cover completely the VisualElement on which it is applied.
QualityGets or sets the quality of the GradientGlowFilter.
StrengthGets or sets the intensity of the GradientGlowFilter.

Inheritance Hierarchy

Object
Filter
GradientGlowFilter

Examples

// This sample shows how to create an AsyncImage class and how to apply a DropShadowFilter on it.

 

using System;

using System.Drawing;

using System.Diagnostics;

using System.Windows.Forms;

using System.Drawing.Filters;

 

public class MyControl : System.Windows.Forms.Control

{

     AsyncImage myAsyncImage;

 

     public MyControl() {}

 

     protected override void OnCreateControl()

     {

          Visual v= this.Visual;

 

          // Initializes the Gradient object with 6 gradient color elements.

          Gradient gd= new Gradient(6);

 

          gd.SetColor( 0, Color.FromArgb(255,0,0) );

          gd.SetAlpha(0, 15); // Sets the new value to alpha value.

          gd.SetOffset( 0, 0 );

 

          gd.SetColor( 1, Color.FromArgb(0,255,0) );

          gd.SetOffset( 1, 50);

 

          gd.SetColor( 2, Color.FromArgb(0,0,255) );

          gd.SetOffset( 2, 100);

 

          gd.SetColor( 3, Color.FromArgb(255,0,0) );

          gd.SetOffset( 3, 150);

 

          gd.SetColor( 4, Color.FromArgb(0,255,0) );

          gd.SetOffset( 4, 200);

 

          gd.SetColor( 5, Color.FromArgb(255,0,255) );

          gd.SetOffset( 5, 250);

 

          // Displays the properties of the initial Gradient.

          Debug.WriteLine("Properties of the initial gradient color element:");

          Debug.WriteLine("\tThe number of the gradient color elements: " +gd.Count);

          Debug.WriteLine("\tThe alpha value: " +gd.GetAlpha(5));

          Debug.WriteLine("\tThe rgb value: " +gd.GetRgb(5));

          Debug.WriteLine("\tThe Color structure: " +gd.GetColor(5));

          Debug.WriteLine("\tThe offset value: " +gd.GetOffset(5));

 

          string url= "http://www.netikatech.com/demos/resources/image.aspx?index=1";

 

          // Creates a new instance of the AsyncImage.

          this.myAsyncImage = new AsyncImage(v, 30, 20 );

          this.myAsyncImage.Load(url );

 

          // Creates a new GradientGlowFilter.

          GradientGlowFilter graGlowFil = new GradientGlowFilter();

 

          // Sets the gradient to the GradientGlowFilter.

          graGlowFil.SetGradient(gd);

 

          // Gets, sets and displays some properties of the GradientGlowFilter object.

          Debug.WriteLine("\nProperties of the Filter:");

          Debug.WriteLine("\tAngle:" +graGlowFil.Angle);

 

          graGlowFil.GlowType= GlowType.Outer;

          Debug.WriteLine("\tGlowType:" +graGlowFil.GlowType);

 

          graGlowFil.BlurX=8;

          Debug.WriteLine("\tBlurX:" +graGlowFil.BlurX);

 

          graGlowFil.BlurY=8;

          Debug.WriteLine("\tBlurY:" +graGlowFil.BlurY);

 

          graGlowFil.Distance=5;

          Debug.WriteLine("\tDistance:" +graGlowFil.Distance);

 

          Debug.WriteLine("\tKnockout:" +graGlowFil.Knockout);

 

          graGlowFil.Quality=4;

          Debug.WriteLine("\tQuality:" +graGlowFil.Quality);

 

          graGlowFil.Strength=5;

          Debug.WriteLine("\tStrength:" +graGlowFil.Strength);

 

          // Applies the GradientGlowFilter to the AsyncImage.

          this.myAsyncImage.ApplyFilter(graGlowFil);

 

          // Creates a new Gradient.

          Gradient copyGrad= new Gradient(6);

 

          // Copies the gradient of the GradinetBevelFilter to a Gradient.

          graGlowFil.CopyGradient(copyGrad);

 

          // Displays the properties of the copy of the initial Gradient.

          Debug.WriteLine("\nProperties of the copy of the initial gradient color element:");

          Debug.WriteLine("\tThe number of the gradient color elements: " +copyGrad.Count);

          Debug.WriteLine("\tThe alpha value: " +copyGrad.GetAlpha(5));

          Debug.WriteLine("\tThe rgb value: " +copyGrad.GetRgb(5));

          Debug.WriteLine("\tThe Color structure: " +copyGrad.GetColor(5));

          Debug.WriteLine("\tThe offset value: " +copyGrad.GetOffset(5));

 

          base.OnCreateControl();

     }

}

 

public class Form1 : System.Windows.Forms.Form

{

     private MyControl control1= null;

 

     public Form1()

     {

          InitializeComponent();

     }

 

     private void InitializeComponent()

     {

          this.SuspendLayout();

          this.control1= new MyControl();

          this.control1.Location= new System.Drawing.Point(10,10);

          this.control1.Size= new Size(Application.Width-10,Application.Height-10);

          this.Controls.Add(this.control1);

          this.ResumeLayout(false);

     }

 

     static void Main()

     {

          Application.Run( new Form1() );

     }

}

 

/*

The output of the sample:

 

Properties of the initial gradient color element:

     The number of the gradient color elements: 6

     The alpha value: 255

     The rgb value: 16711935

     The Color structure: Color [R=255,G=0,B=255,A=255]

     The offset value: 250

 

Properties of the Filter:

     Angle:44.9999999772279

     GlowType:1

     BlurX:8

     BlurY:8

     Distance:5

     Knockout:False

     Quality:4

     Strength:5

 

Properties of the copy of the initial gradient color element:

     The number of the gradient color elements: 6

     The alpha value: 255

     The rgb value: 16711935

     The Color structure: Color [R=255,G=0,B=255,A=255]

     The offset value: 250

 

*/

 

Class Information

NamespaceSystem.Drawing.Filters
Flash LibrarySystem.Windows.Forms.scl
Flash Library Version2.0.0.2118
Silverlight LibrarySystem.Windows.Forms.dll



© 2003-2007 NETiKA Technologies. All rights reserved.