Represents a shadow filter. It adds a shadow to the VisualElement it is applied on.
public class DropShadowFilter: Filter
ObjectFilterDropShadowFilter
// 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 );
// 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);
Debug.WriteLine("\tQuality:" +dropShaFil.Quality);
Debug.WriteLine("\tColor:" +dropShaFil.Color);
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);
}
}
public class Form1 : System.Windows.Forms.Form
{
private MyControl control1= null;
public Form1()
{
InitializeComponent();
}
private void InitializeComponent()
{
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);
}
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
*/
Namespace System.Drawing.Filters Flash Library System.Windows.Forms.scl Flash Library Version 2.0.0.2118 Silverlight Library System.Windows.Forms.dll
| © 2003-2007 NETiKA Technologies. All rights reserved. |