'...
'Create an instance of ImageElement class
Dim imgElem As Neodynamic.SDK.ImageElement
imgElem = Neodynamic.SDK.ImageElement.FromUrl("~/images/night.jpg")
'Create an instance of ConvertToBlackWhite class
Dim fxBW As New Neodynamic.SDK.ConvertToBlackWhite()
fxBW.DitherMethod = Neodynamic.SDK.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.SDK.ImageElement imgElem = Neodynamic.SDK.ImageElement.FromUrl("~/images/night.jpg");
//Create an instance of ConvertToBlackWhite class
Neodynamic.SDK.ConvertToBlackWhite fxBW = new Neodynamic.SDK.ConvertToBlackWhite();
fxBW.DitherMethod = Neodynamic.SDK.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.