public class SmoothCommandEventArgs : EventArgs
Public Class SmoothCommandEventArgs
Inherits System.EventArgs
@interface LTSmoothCommandEventArgs : NSObject
public class SmoothCommandEvent extends LeadEvent
public ref class SmoothCommandEventArgs : public System.EventArgs
Run the SmoothCommand on an image.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
public void SmoothCommandEventArgsExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"));
// Prepare the command
SmoothCommand 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";
else
BumpOrNeck = "Neck";
string Direction;
if (ee.Direction == SmoothCommandDirectionType.Horizontal)
Direction = "Horizontal";
else
Direction = "Vertical";
e.Status = RemoveStatus.Remove;
System.Diagnostics.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);
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images";
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core
Public WithEvents smoothEventExample_S4 As SmoothCommand
Public Sub SmoothCommandEventArgsExample()
Dim codecs As New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Clean.tif"))
' Prepare the command
smoothEventExample_S4 = New SmoothCommand(SmoothCommandFlags.FavorLong Or SmoothCommandFlags.SingleRegion Or SmoothCommandFlags.LeadRegion, 2)
smoothEventExample_S4.Run(leadImage)
End Sub
Private Sub SmoothEventExample_SmoothCommand(ByVal sender As Object, ByVal e As SmoothCommandEventArgs) Handles smoothEventExample_S4.Smooth
Dim ee As SmoothCommandEventArgs = New SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction)
Dim BumpOrNeck As String
If (ee.BumpNick = SmoothCommandBumpNickType.Bump) Then
BumpOrNeck = "Bump"
Else
BumpOrNeck = "Neck"
End If
Dim Direction As String
If (ee.Direction = SmoothCommandDirectionType.Horizontal) Then
Direction = "Horizontal"
Else
Direction = "Vertical"
End If
e.Status = RemoveStatus.Remove
MessageBox.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 Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images"
End Class
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
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.