'...
'Create an instance of ImageElement class
Dim imgElem As Neodynamic.SDK.ImageElement
imgElem = Neodynamic.SDK.ImageElement.FromUrl("~/images/night.jpg")
'Create an instance of PerspectiveShadow class
Dim perspectiveShadow As New Neodynamic.SDK.PerspectiveShadow()
perspectiveShadow.Color = System.Drawing.Color.Gray
perspectiveShadow.Length = 30
perspectiveShadow.Softness = 1
'Apply the action on the ImageElement
imgElem.Actions.Add(perspectiveShadow)
'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 PerspectiveShadow class
Neodynamic.SDK.PerspectiveShadow perspectiveShadow = new Neodynamic.SDK.PerspectiveShadow();
perspectiveShadow.Color = System.Drawing.Color.Gray;
perspectiveShadow.Length = 30;
perspectiveShadow.Softness = 1;
//Apply the action on the ImageElement
imgElem.Actions.Add(perspectiveShadow);
//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 PerspectiveShadow class
Dim perspectiveShadow As New Neodynamic.SDK.PerspectiveShadow()
perspectiveShadow.Color = System.Drawing.Color.DodgerBlue
perspectiveShadow.Length = 40
perspectiveShadow.Softness = 1
perspectiveShadow.Angle = 90
perspectiveShadow.WidthPercentage = 200
'Apply the action on the ImageElement
imgElem.Actions.Add(perspectiveShadow)
'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 PerspectiveShadow class
Neodynamic.SDK.PerspectiveShadow perspectiveShadow = new Neodynamic.SDK.PerspectiveShadow();
perspectiveShadow.Color = System.Drawing.Color.DodgerBlue;
perspectiveShadow.Length = 40;
perspectiveShadow.Softness = 1;
perspectiveShadow.Angle = 90;
perspectiveShadow.WidthPercentage = 200;
//Apply the action on the ImageElement
imgElem.Actions.Add(perspectiveShadow);
//Add the ImageElement to the Elements collection of the ImageDraw controlthis.ImageDraw1.Elements.Add(imgElem);
//...
This action adds perspective shadows to an Element. ImageDraw makes it easy to apply perspective shadows to any Element allowing you to specify the following shadow settings:
Angle: to set the direction of the perspective 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.
Length: to set the length of the perspective shadow.
Width Percentage: to set the width percentage of the perspective shadow based on the Element's width.
Softness: to set the sharpness of the perspective shadow.
Examples
1. In the following example we have an ImageElement on the Canvas and a simple PerspectiveShadow action is applied on the ImageElement.
ImageElement before the action is applied.
ImageElement with PerspectiveShadow action applied on it.
Syntax sample
2. In the following example the same ImageElement of the previous sample but with other perspective shadow settings.
ImageElement before the action is applied.
ImageElement with PerspectiveShadow action applied on it.