Handles each bump or nick found by the SmoothCommand.
public class SmoothCommandEventArgs : System.EventArgsPublic Class SmoothCommandEventArgsInherits System.EventArgs
public sealed class SmoothCommandEventArgs : System.EventArgs@interface LTSmoothCommandEventArgs : NSObjectpublic class SmoothCommandEvent extends LeadEventfunction Leadtools.ImageProcessing.Core.SmoothCommandEventArgs()public ref class SmoothCommandEventArgs : public System.EventArgsRun the SmoothCommand on an image.
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessing.CorePublic WithEvents smoothEventExample_S4 As SmoothCommandPublic Sub SmoothCommandEventArgsExample()Dim codecs As New RasterCodecs()codecs.ThrowExceptionsOnInvalidImages = TrueDim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Clean.tif"))' Prepare the commandsmoothEventExample_S4 = New SmoothCommand(SmoothCommandFlags.FavorLong Or SmoothCommandFlags.SingleRegion Or SmoothCommandFlags.LeadRegion, 2)smoothEventExample_S4.Run(leadImage)End SubPrivate Sub SmoothEventExample_SmoothCommand(ByVal sender As Object, ByVal e As SmoothCommandEventArgs) Handles smoothEventExample_S4.SmoothDim ee As SmoothCommandEventArgs = New SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction)Dim BumpOrNeck As StringIf (ee.BumpNick = SmoothCommandBumpNickType.Bump) ThenBumpOrNeck = "Bump"ElseBumpOrNeck = "Neck"End IfDim Direction As StringIf (ee.Direction = SmoothCommandDirectionType.Horizontal) ThenDirection = "Horizontal"ElseDirection = "Vertical"End Ife.Status = RemoveStatus.RemoveMessageBox.Show("The width of the image is: " & e.Image.Width & Chr(13) & "The height of the image is: " & e.Image.Height & Chr(13) & " Bump Or Neck : " & BumpOrNeck & Chr(13) & "Direction : " & Direction)End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing.Core;public void SmoothCommandEventArgsExample(){// Load an imageRasterCodecs codecs = new RasterCodecs();codecs.ThrowExceptionsOnInvalidImages = true;RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"));// Prepare the commandSmoothCommand command = new SmoothCommand(SmoothCommandFlags.FavorLong | SmoothCommandFlags.SingleRegion | SmoothCommandFlags.LeadRegion, 2);command.Smooth += new EventHandler<SmoothCommandEventArgs>(SmoothEventExample_S4);command.Run(image);}private void SmoothEventExample_S4(object sender, SmoothCommandEventArgs e){SmoothCommandEventArgs ee = new SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction);string BumpOrNeck;if (ee.BumpNick == SmoothCommandBumpNickType.Bump)BumpOrNeck = "Bump";elseBumpOrNeck = "Neck";string Direction;if (ee.Direction == SmoothCommandDirectionType.Horizontal)Direction = "Horizontal";elseDirection = "Vertical";e.Status = RemoveStatus.Remove;MessageBox.Show("The width of the image is: " + e.Image.Width + "\n" + "The height of the image is: " + e.Image.Height + "\n" + " Bump Or Neck : " + BumpOrNeck + "\n" + "Direction : " + Direction);}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing.Core;public async Task SmoothCommandEventArgsExample(){// Load an imageRasterCodecs codecs = new RasterCodecs();codecs.ThrowExceptionsOnInvalidImages = true;// Load the imagestring srcFileName = @"Assets\Clean.tif";StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));// Prepare the commandSmoothCommand command = new SmoothCommand(SmoothCommandFlags.FavorLong | SmoothCommandFlags.SingleRegion | SmoothCommandFlags.LeadRegion, 2);command.Smooth += new EventHandler<SmoothCommandEventArgs>(SmoothEventExample_S4);command.Run(image);}private void SmoothEventExample_S4(object sender, SmoothCommandEventArgs e){SmoothCommandEventArgs ee = new SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction);string BumpOrNeck;if (ee.BumpNick == SmoothCommandBumpNickType.Bump)BumpOrNeck = "Bump";elseBumpOrNeck = "Neck";string Direction;if (ee.Direction == SmoothCommandDirectionType.Horizontal)Direction = "Horizontal";elseDirection = "Vertical";e.Status = RemoveStatus.Remove;Debug.WriteLine("The width of the image is: " + e.Image.Width + "\n" + "The height of the image is: " + e.Image.Height + "\n" + " Bump Or Neck : " + BumpOrNeck + "\n" + "Direction : " + Direction);}
using Leadtools;using Leadtools.Examples;using Leadtools.Codecs;using Leadtools.ImageProcessing.Core;public void SmoothCommandEventArgsExample(RasterImage image){// Load an imageRasterCodecs codecs = new RasterCodecs();codecs.ThrowExceptionsOnInvalidImages = true;// Prepare the commandSmoothCommand command = new SmoothCommand(SmoothCommandFlags.FavorLong | SmoothCommandFlags.SingleRegion | SmoothCommandFlags.LeadRegion, 2);command.Smooth += new EventHandler<SmoothCommandEventArgs>(SmoothEventExample_S4);command.Run(image);}private void SmoothEventExample_S4(object sender, SmoothCommandEventArgs e){SmoothCommandEventArgs ee = new SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction);string BumpOrNeck;if (ee.BumpNick == SmoothCommandBumpNickType.Bump)BumpOrNeck = "Bump";elseBumpOrNeck = "Neck";string Direction;if (ee.Direction == SmoothCommandDirectionType.Horizontal)Direction = "Horizontal";elseDirection = "Vertical";e.Status = RemoveStatus.Remove;Debug.WriteLine("The width of the image is: " + e.Image.Width + "\n" + "The height of the image is: " + e.Image.Height + "\n" + " Bump Or Neck : " + BumpOrNeck + "\n" + "Direction : " + Direction);}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessing.CorePublic Sub SmoothCommandEventArgsExample(ByVal image As RasterImage)' Load an imageDim codecs As RasterCodecs = New RasterCodecs()codecs.ThrowExceptionsOnInvalidImages = True' Prepare the commandDim command As SmoothCommand = New SmoothCommand(SmoothCommandFlags.FavorLong Or SmoothCommandFlags.SingleRegion Or SmoothCommandFlags.LeadRegion, 2)AddHandler command.Smooth, AddressOf SmoothEventExample_S4command.Run(image)End SubPrivate Sub SmoothEventExample_S4(ByVal sender As Object, ByVal e As SmoothCommandEventArgs)Dim ee As SmoothCommandEventArgs = New SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction)Dim BumpOrNeck As StringIf ee.BumpNick = SmoothCommandBumpNickType.Bump ThenBumpOrNeck = "Bump"ElseBumpOrNeck = "Neck"End IfDim Direction As StringIf ee.Direction = SmoothCommandDirectionType.Horizontal ThenDirection = "Horizontal"ElseDirection = "Vertical"End Ife.Status = RemoveStatus.RemoveDebug.WriteLine("The width of the image is: " & e.Image.Width + Constants.vbLf & "The height of the image is: " & e.Image.Height + Constants.vbLf & _" Bump Or Neck : " & BumpOrNeck & Constants.vbLf & "Direction : " & Direction)End Sub
|
Products |
Support |
Feedback: SmoothCommandEventArgs Class - Leadtools.ImageProcessing.Core |
Introduction |
Help Version 19.0.2017.3.21
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.