Initializes a new AutoSegmentCommand class object with explicit parameters.
Syntax
Visual Basic (Declaration) | |
---|
Public Function New( _
ByVal rect As Rectangle _
) |
Parameters
- rect
-
The Segmentation Rectangle surrounding the object to be segmented
Example
Runs the AutoSegmentCommand on the Image.
Visual Basic | Copy Code |
---|
Public Sub AutoSegmentConstructorExample()
RasterCodecs.Startup()
Dim codecs As New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")
Dim command As AutoSegmentCommand = New AutoSegmentCommand(New Rectangle(50, 100, 100, 150))
command.Run(leadImage)
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
public void AutoSegmentConstructorExample() { // 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 // Apply AutoSegmentCommand command = new AutoSegmentCommand(new Rectangle(25, 25, 50, 100)); command.Run(image); RasterCodecs.Shutdown(); } |
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