'...
'Create an instance of ImageElement class
Dim imgElem As Neodynamic.WebControls.ImageDraw.ImageElement
imgElem = Neodynamic.WebControls.ImageDraw.ImageElement.FromUrl("~/images/night.jpg")
'Create an instance of GlassTable class
Dim glassTable As New Neodynamic.WebControls.ImageDraw.GlassTable()
glassTable.ReflectionOpacity = 50
glassTable.ReflectionPercentage = 25
'Apply the action on the ImageElement
imgElem.Actions.Add(glassTable)
'Add the ImageElement to the Elements collection of the ImageDraw control
Me.ImageDraw1.Elements.Add(imgElem)
'...
//...
//Create an instance of ImageElement class
Neodynamic.WebControls.ImageDraw.ImageElement imgElem = Neodynamic.WebControls.ImageDraw.ImageElement.FromUrl("~/images/night.jpg");
//Create an instance of GlassTable class
Neodynamic.WebControls.ImageDraw.GlassTable glassTable = new Neodynamic.WebControls.ImageDraw.GlassTable();
glassTable.ReflectionOpacity = 50;
glassTable.ReflectionPercentage = 25;
//Apply the action on the ImageElement
imgElem.Actions.Add(glassTable);
//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.WebControls.ImageDraw.ImageElement
imgElem = Neodynamic.WebControls.ImageDraw.ImageElement.FromUrl("~/images/night.jpg")
'Create an instance of TextElement class
Dim txtElem As New Neodynamic.WebControls.ImageDraw.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 GlassTable class
Dim glassTable As New Neodynamic.WebControls.ImageDraw.GlassTable()
glassTable.ReflectionLocation = Neodynamic.WebControls.ImageDraw.ReflectionLocation.Custom
glassTable.ReflectionLocationY = 15
'Apply the action on the TextElement
txtElem.Actions.Add(glassTable)
'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.WebControls.ImageDraw.ImageElement imgElem = Neodynamic.WebControls.ImageDraw.ImageElement.FromUrl("~/images/night.jpg");
//Create an instance of TextElement class
Neodynamic.WebControls.ImageDraw.TextElement txtElem = new Neodynamic.WebControls.ImageDraw.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 GlassTable class
Neodynamic.WebControls.ImageDraw.GlassTable glassTable = new Neodynamic.WebControls.ImageDraw.GlassTable();
glassTable.ReflectionLocation = Neodynamic.WebControls.ImageDraw.ReflectionLocation.Custom;
glassTable.ReflectionLocationY = 15;
//Apply the action on the TextElement
txtElem.Actions.Add(glassTable);
//Add the Element objects to the Elements collection of the ImageDraw controlthis.ImageDraw1.Elements.Add(imgElem);
this.ImageDraw1.Elements.Add(txtElem);
//...
This action creates a glass table effect (a.k.a. Reflection effect) on an Element. ImageDraw makes it easy to apply reflection effect on any Element showing it as it was standing on a glass table. You have full control over the action allowing you to specify the following settings:
Location: to set how the reflection of the Element will be positioned. If it is Auto, then the reflection will be positioned just below of the Element based on its dimensions; otherwise, the reflection position must be specified by Location X and Location Y.
Location X: to set the x-coordinate of the left side of the reflection object.
Location Y: to set the y-coordinate of the top side of the reflection object.
Opacity: to set the percentage of transparency in the reflection.
Reflection Percentage: to set the percentage of the Element height that will be reflected.
Examples
1. In the following example we have an ImageElement on the Canvas and a GlassTable action is applied on the ImageElement.
ImageElement before the action is applied.
ImageElement with GlassTable action applied on it.
Syntax sample
2. In the following example we have an ImageElement and a TextElement on the Canvas and a GlassTable action is applied on the TextElement only. Notice that in this case the Reflection had to be "manually positioned" because "g" letter.