Leadtools.Mrc Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
AddSegment Method
See Also  Example
Leadtools.Mrc Namespace > MrcSegmenter Class : AddSegment Method



image
The image in which the segment will be created.
data
Information about the segment that will be added.
image
The image in which the segment will be created.
data
Information about the segment that will be added.
Adds a new segment manually and sets the segment information.

Syntax

Visual Basic (Declaration) 
Public Function AddSegment( _
   ByVal image As RasterImage, _
   ByVal data As MrcSegmentData _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As MrcSegmenter
Dim image As RasterImage
Dim data As MrcSegmentData
Dim value As Integer
 
value = instance.AddSegment(image, data)
C# 
public int AddSegment( 
   RasterImage image,
   MrcSegmentData data
)
C++/CLI 
public:
int AddSegment( 
   RasterImage image,
   MrcSegmentData data
) 

Parameters

image
The image in which the segment will be created.
data
Information about the segment that will be added.

Example

Visual BasicCopy Code
Public Sub AddSegmentExample()
    ' Load an image
    RasterCodecs.Startup()
    Dim codecs As RasterCodecs = New RasterCodecs()
    codecs.ThrowExceptionsOnInvalidImages = True

    Dim image As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")

    Dim mrcSegmenter As MrcSegmenter = New MrcSegmenter(image, Color.White, Color.Black)

    Dim data As MrcSegmentData = MrcSegmentData.Empty
    data.ImageSegment = New Rectangle(0, 0, 20, 60)
    data.SegmentType = MrcSegmentType.Picture
    mrcSegmenter.AddSegment(image, data)
End Sub
C#Copy Code
public void AddSegmentExample() 

   // Load an image 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg"); 
 
   MrcSegmenter mrcSegmenter = new MrcSegmenter(image, Color.White, Color.Black); 
 
   MrcSegmentData data = MrcSegmentData.Empty; 
   data.ImageSegment = new Rectangle(0, 0, 20, 60); 
   data.SegmentType = MrcSegmentType.Picture; 
   mrcSegmenter.AddSegment(image, data); 
}

Remarks

This method adds a new segment using the coordinates and the type specified in the data parameter.

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

Leadtools.Mrc requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features