'...
'Create an instance of ImageElement class
Dim imgElem As Neodynamic.SDK.ImageElement
imgElem = Neodynamic.SDK.ImageElement.FromUrl("~/images/night.jpg")
'Create an instance of DropShadow class
Dim dropShadow As New Neodynamic.SDK.DropShadow()
'Apply the action on the ImageElement
imgElem.Actions.Add(dropShadow)
'Add the ImageElement to the Elements collection of the ImageDraw control
Me.ImageDraw1.Elements.Add(imgElem)
'...
//...
//Create an instance of ImageElement class
Neodynamic.SDK.ImageElement imgElem = Neodynamic.SDK.ImageElement.FromUrl("~/images/night.jpg");
//Create an instance of DropShadow class
Neodynamic.SDK.DropShadow dropShadow = new Neodynamic.SDK.DropShadow();
//Apply the action on the ImageElement
imgElem.Actions.Add(dropShadow);
//Add the ImageElement to the Elements collection of the ImageDraw controlthis.ImageDraw1.Elements.Add(imgElem);
//...
'...
'Create an instance of ImageElement class
Dim imgElem As Neodynamic.SDK.ImageElement
imgElem = Neodynamic.SDK.ImageElement.FromUrl("~/images/night.jpg")
'Create an instance of TextElement class
Dim txtElem As New Neodynamic.SDK.TextElement
txtElem.Font.Name = "Segoe UI"
txtElem.Font.Size = 20.25F
txtElem.Font.Bold = True
txtElem.ForeColor = System.Drawing.Color.White
txtElem.StrokeColor = System.Drawing.Color.Black
txtElem.StrokeWidth = 3
txtElem.Text = "Wonderful Night"
txtElem.X = 5
txtElem.Y = 120
'Create an instance of DropShadow class
Dim dropShadow As New Neodynamic.SDK.DropShadow()
dropShadow.Angle = 270
dropShadow.Color = System.Drawing.Color.Lime
dropShadow.Softness = 10
'Apply the action on the TextElement
txtElem.Actions.Add(dropShadow)
'Add the Element objects to the Elements collection of the ImageDraw control
Me.ImageDraw1.Elements.Add(imgElem)
Me.ImageDraw1.Elements.Add(txtElem)
'...
//...
//Create an instance of ImageElement class
Neodynamic.SDK.ImageElement imgElem = Neodynamic.SDK.ImageElement.FromUrl("~/images/night.jpg");
//Create an instance of TextElement class
Neodynamic.SDK.TextElement txtElem = new Neodynamic.SDK.TextElement();
txtElem.Font.Name = "Segoe UI";
txtElem.Font.Size = 20.25f;
txtElem.Font.Bold = true;
txtElem.ForeColor = System.Drawing.Color.White;
txtElem.StrokeColor = System.Drawing.Color.Black;
txtElem.StrokeWidth = 3;
txtElem.Text = "Wonderful Night";
txtElem.X = 5;
txtElem.Y = 120;
//Create an instance of DropShadow class
Neodynamic.SDK.DropShadow dropShadow = new Neodynamic.SDK.DropShadow();
dropShadow.Angle = 270;
dropShadow.Color = System.Drawing.Color.Lime;
dropShadow.Softness = 10;
//Apply the action on the TextElement
txtElem.Actions.Add(dropShadow);
//Add the Element objects to the Elements collection of the ImageDraw controlthis.ImageDraw1.Elements.Add(imgElem);
this.ImageDraw1.Elements.Add(txtElem);
//...
'...
'Create an instance of ImageElement class
Dim imgElem As Neodynamic.SDK.ImageElement
imgElem = Neodynamic.SDK.ImageElement.FromUrl("~/images/film.png")
'Create an instance of DropShadow class
Dim dropShadow As New Neodynamic.SDK.DropShadow()
dropShadow.Opacity = 50
dropShadow.Color = System.Drawing.Color.DarkOrange
'Apply the action on the ImageElement
imgElem.Actions.Add(dropShadow)
'Add the ImageElement to the Elements collection of the ImageDraw control
Me.ImageDraw1.Elements.Add(imgElem)
'...
//...
//Create an instance of ImageElement class
Neodynamic.SDK.ImageElement imgElem = Neodynamic.SDK.ImageElement.FromUrl("~/images/film.png");
//Create an instance of DropShadow class
Neodynamic.SDK.DropShadow dropShadow = new Neodynamic.SDK.DropShadow();
dropShadow.Opacity = 50;
dropShadow.Color = System.Drawing.Color.DarkOrange;
//Apply the action on the ImageElement
imgElem.Actions.Add(dropShadow);
//Add the ImageElement to the Elements collection of the ImageDraw controlthis.ImageDraw1.Elements.Add(imgElem);
//...
This action adds drop shadows to an Element. ImageDraw makes it easy to apply drop shadows to any Element allowing you to specify the following shadow settings:
Angle: to set the direction of the shadow and to simulate the angle of the light shining on the object. It is measured counterclockwise from the x-axis.
Color: to set the color of the shadow.
Distance: to set the distance of the shadow from the Element.
Opacity: to set the percentage of transparency in the shadow.
Softness: to set the sharpness of the shadow.
Examples
1. In the first example we have two ImageElement objects on the Canvas anda simple DropShadow action is applied on it.
ImageElement before the action is applied.
ImageElement with DropShadow action applied on it.
Syntax sample
2. In the following example we have an ImageElement and a TextElement on the Canvas and a DropShadow action is applied on the TextElement only.
TextElement before the action is applied.
TextElement with DropShadow action applied on it.
Syntax sample
3. In the following example we have an ImageElement wrapping an "irregular" image on the Canvas and a DropShadow action is applied on the ImageElement. Notice how the image boundaries are maintained on the shadow.
ImageElement before the action is applied.
ImageElement with DropShadow action applied on it.