Leadtools.ImageProcessing.Core Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
ObjectCounterCommandEventArgs Class
See Also  Members   Example 
Leadtools.ImageProcessing.Core Namespace : ObjectCounterCommandEventArgs Class



Handles each object found by ObjectCounterCommand.

Syntax

Visual Basic (Declaration) 
Public Class ObjectCounterCommandEventArgs 
   Inherits EventArgs
Visual Basic (Usage)Copy Code
Dim instance As ObjectCounterCommandEventArgs
C# 
public class ObjectCounterCommandEventArgs : EventArgs 
C++/CLI 
public ref class ObjectCounterCommandEventArgs : public EventArgs 

Example

Runs the ObjectCounterCommand on an image.

Visual BasicCopy Code
Public WithEvents objectCounterCommand_S2 As ObjectCounterCommand
Public Sub ObjectCounterCommandEventArgsExample()
   RasterCodecs.Startup()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Clean.tif")

   ' Prepare the command
   objectCounterCommand_S2 = New ObjectCounterCommand
   objectCounterCommand_S2.Run(leadImage)

   RasterCodecs.Shutdown()
End Sub

Private Sub ObjectCounterCommand_ObjectCounter_S2(ByVal sender As Object, ByVal e As ObjectCounterCommandEventArgs) Handles objectCounterCommand_S2.ObjectCounter
   Dim ee As ObjectCounterCommandEventArgs = New ObjectCounterCommandEventArgs(e.ObjectRectangle, e.ObjectData)

End Sub
C#Copy Code
public void ObjectCounterCommandEventArgsExample() 

    // Load an image 
    RasterCodecs.Startup(); 
    RasterCodecs codecs = new RasterCodecs(); 
    codecs.ThrowExceptionsOnInvalidImages = true; 
 
       RasterImage image =codecs.Load( "D:\\Lead15\\images2\\LEADTOOLS Images\\Master.jpg"); 
 
    // Prepare the command 
    ObjectCounterCommand command = new ObjectCounterCommand(); 
    command.ObjectCounter += new EventHandler<ObjectCounterCommandEventArgs>(ObjectCounterEvent_S2); 
    command.Run(image); 
 
    RasterCodecs.Shutdown(); 

 
private void ObjectCounterEvent_S2(object sender, ObjectCounterCommandEventArgs e) 

    ObjectCounterCommandEventArgs ee = new ObjectCounterCommandEventArgs(e.ObjectRectangle, e.ObjectData); 
 
}

Inheritance Hierarchy

System.Object
   System.EventArgs
      Leadtools.ImageProcessing.Core.ObjectCounterCommandEventArgs

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also