GOA - System.Drawing.Filters.DropShadowFilter

DropShadowFilter Class


Represents a shadow filter. It adds a shadow to the VisualElement it is applied on.

Definition

public class DropShadowFilter: Filter

Members Table

MethodDescription
CloneCreates a shallow copy of the current Filter. (Inherited from Filter)
DropShadowFilterInitializes a new instance of DropShadowFilter.
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)
ReferenceEqualsDetermines whether the specified Object instances are the same instance. (Inherited from Object)
ToStringReturns a String that represents the current Object. (Inherited from Object)
PropertyDescription
AngleGets or sets the angle to apply to the DropShadowFilter.
BlurXGets or sets the level of blurring of the DropShadowFilter horizontally.
BlurYGets or sets the level of blurring of the DropShadowFilter vertically.
ColorGets or sets the Color of the DropShadowFilter.
DistanceGets or sets the distance of the DropShadowFilter from the background.
HideObjectGets or sets a value indicating whether the DropShadowFilter has to hide the VisualElement.
InnerGets or sets a value indictaing whether the shadow has to be inside the VisualElement.
KnockoutGets or sets a value indicating whether the DropShadowFilter has to cover completely the VisualElement on which it is applied.
QualityGets or sets the quality of the DropShadowFilter.
StrengthGets or sets the intensity of the DropShadowFilter.

Inheritance Hierarchy

Object
Filter
DropShadowFilter

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;

          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 DropShadowFilter.

          DropShadowFilter dropShaFil = new DropShadowFilter();

 

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

          Debug.WriteLine("Properties of the Filter:");

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

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

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

 

          dropShaFil.Quality=10;

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

 

          Debug.WriteLine("\tColor:" +dropShaFil.Color);

 

          dropShaFil.Distance=20;

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

 

          Debug.WriteLine("\tHideObject:" +dropShaFil.HideObject);

          Debug.WriteLine("\tInner:" +dropShaFil.Inner);

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

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

 

          // Applies the DropShadowFilter to the AsyncImage.

          this.myAsyncImage.ApplyFilter(dropShaFil);

 

          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 Filter:

     Angle:44.9999999772279

     BlurX:4

     BlurY:4

     Quality:10

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

     Distance:20

     HideObject:False

     Inner:False

     Knockout:False

     Strength:1

 

*/

 

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.