public SmoothCommandEventArgs(RasterImage image,SmoothCommandBumpNickType bumpNick,int startRow,int startColumn,int length,SmoothCommandDirectionType direction)
Public Function New( _ByVal image As RasterImage, _ByVal bumpNick As SmoothCommandBumpNickType, _ByVal startRow As Integer, _ByVal startColumn As Integer, _ByVal length As Integer, _ByVal direction As SmoothCommandDirectionType _)
public SmoothCommandEvent(Object source,RasterImage image,SmoothCommandBumpNickType bumpNick,int startRow,int startColumn,int length,SmoothCommandDirectionType direction)
public:SmoothCommandEventArgs(RasterImage^ image,SmoothCommandBumpNickType bumpNick,int startRow,int startColumn,int length,SmoothCommandDirectionType direction)
image
RasterImage object that references the affected image.
bumpNick
Value that indicates whether to remove bumps or fill in nicks.
startRow
The starting row of the bump or nick. The rows are zero-based.
startColumn
The starting column of the bump or nick. The columns are zero-based.
length
Length (in pixels) of the bump or nick.
direction
Flag that indicates whether the element being smoothed is vertical or horizontal.
Run the SmoothCommand on an image.
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;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 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:\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
