'...
'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 ConvertToBlackWhite class
Dim fxBW As New Neodynamic.WebControls.ImageDraw.ConvertToBlackWhite()
fxBW.DitherMethod = Neodynamic.WebControls.ImageDraw.DitherMethod.Threshold
fxBW.Threshold = 53
'Apply the action on the ImageElement
imgElem.Actions.Add(fxBW)
'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 ConvertToBlackWhite class
Neodynamic.WebControls.ImageDraw.ConvertToBlackWhite fxBW = new Neodynamic.WebControls.ImageDraw.ConvertToBlackWhite();
fxBW.DitherMethod = Neodynamic.WebControls.ImageDraw.DitherMethod.Threshold;
fxBW.Threshold = 53;
//Apply the action on the ImageElement
imgElem.Actions.Add(fxBW);
//Add the ImageElement to the Elements collection of the ImageDraw controlthis.ImageDraw1.Elements.Add(imgElem);
//...
This action converts an Element to black/white or monochrome. ImageDraw provides three different Dithering methods for black & white conversion including Simple Threshold, Pattern Diffusion and Floyd-Steinberg algorithm.
In the following example we have an ImageElement on the Canvas and a ConvertToBlackWhite action is applied on the ImageElement.
ImageElement before the action is applied.
ImageElement with ConvertToBlackWhite action applied on it.