public event EventHandler<DotRemoveCommandEventArgs> DotRemove
typedef void (^LTDotRemoveCommandStatus)(LTRasterImage *image, LTDotRemoveCommandEventArgs *args, LTRemoveStatus *status)
- (BOOL)run:(LTRasterImage *)image
progress:(nullable LTRasterCommandProgress)progressHandler
status:(nullable LTDotRemoveCommandStatus)dotRemoveStatus
error:(NSError **)error
public void addDotRemoveCommandListener(DotRemoveCommandListener listener)
public void removeDotRemoveCommandListener(DotRemoveCommandListener listener)
public:
event EventHandler<DotRemoveCommandEventArgs^>^ DotRemove
def DotRemove(sender,e): # sender: DotRemoveCommand e: DotRemoveCommandEventArgs
The event handler receives an argument of type DotRemoveCommandEventArgs containing data related to this event. The following DotRemoveCommandEventArgs properties provide information specific to this event.
Property | Description |
---|---|
BlackCount | Gets the total number of black pixels in the dot being processed. |
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
public void DotRemoveCommandExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Clean.tif"));
// Prepare the command
DotRemoveCommand command = new DotRemoveCommand();
command.DotRemove += new EventHandler<DotRemoveCommandEventArgs>(DotRemoveEvent_S1);
command.Flags = DotRemoveCommandFlags.UseSize;
command.MaximumDotHeight = 10;
command.MaximumDotWidth = 10;
command.MinimumDotHeight = 1;
command.MinimumDotWidth = 1;
command.Run(image);
}
private void DotRemoveEvent_S1(object sender, DotRemoveCommandEventArgs e)
{
System.Diagnostics.Debug.WriteLine("Size " + e.BoundingRectangle.Width + e.BoundingRectangle.Height + "Bounds"
+ e.BoundingRectangle.Left + "," + e.BoundingRectangle.Top + "," + e.BoundingRectangle.Right + "," + e.BoundingRectangle.Bottom + ","
+ " WhiteCount" + e.WhiteCount + " BlackCount" + e.BlackCount, "DotRemove Event");
//Do not remove the speck if it contains any white pixels
if (e.WhiteCount > 0)
{
e.Status = RemoveStatus.NoRemove;
}
else
{
e.Status = RemoveStatus.Remove;
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
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