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



objectrectangle
Rectangle surrounding the object.
objectdata
Two dimension array containing the location of the pixels belonging to the object. Elements in the array with value 1 belong to the object, otherwise they do not
Initializes a new ObjectCounterCommand with explicit parameters.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal objectrectangle As Rectangle, _
   ByVal objectdata() As Integer _
)
Visual Basic (Usage)Copy Code
Dim objectrectangle As Rectangle
Dim objectdata() As Integer
 
Dim instance As ObjectCounterCommandEventArgs(objectrectangle, objectdata)
C# 
public ObjectCounterCommandEventArgs( 
   Rectangle objectrectangle,
   int[] objectdata
)
C++/CLI 
public:
ObjectCounterCommandEventArgs( 
   Rectangle objectrectangle,
   array<int>^ objectdata
)

Parameters

objectrectangle
Rectangle surrounding the object.
objectdata
Two dimension array containing the location of the pixels belonging to the object. Elements in the array with value 1 belong to the object, otherwise they do not

Example

Run 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); 
 
}

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