LSegment::MrcCreateNewSegment

#include "ltwrappr.h"

L_INT LSegment::MrcCreateNewSegment(pBitmap, pSegment)

Manually adds a new segment to a specific stripe and sets the segment information.

Parameters

LBitmapBase * pBitmap

Pointer to an LBitmapBase object that references the bitmap in which the segment will be created.

pSEGMENTDATA pSegment

Pointer to the SEGMENTDATA structure that contains the segment information.

Returns

Value Meaning
>= 0 Index of the newly added segment.
< 1 An error occurred. Refer to Return Codes.

Comments

Use this function to manually add a new segment using the coordinates and type specified in pSegment.

Call the LSegment::MrcStartBitmapSegmentation function before using any of the segmentation functions. When the LSegment class object is no longer needed, free it by calling the LSegment::MrcStopBitmapSegmentation function.

Required DLLs and Libraries

See Also

Elements

Topics

Example

The following example illustrates the use of LSegment::MrcCreateNewSegment in performing manual segmentation.

L_INT LSegment__MrcCreateNewSegmentExample(LBitmapBase & Bitmap) 
{ 
   LSegment       Segment; 
   SEGMENTDATA    SegData; 
   L_INT          nRet; 
 
   // Initialize the segmentation process 
   nRet = Segment.MrcStartBitmapSegmentation(&Bitmap, 
                                      RGB(255, 255, 255),  
                                      RGB(0, 0, 0)); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   SegData.uStructSize = sizeof(SEGMENTDATA); 
   SegData.rcBitmapSeg.left = 20; 
   SegData.rcBitmapSeg.top = 20; 
   SegData.rcBitmapSeg.right = 60; 
   SegData.rcBitmapSeg.bottom = 60; 
   SegData.uType = SEGTYPE_PICTURE; 
 
   // Add a segment to the stripe just set 
   nRet = Segment.MrcCreateNewSegment(&Bitmap, &SegData); 
   if(nRet < 1) 
      return nRet; 
 
   // Clean up 
   nRet = Segment.MrcStopBitmapSegmentation(); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 

Help Version 20.0.2019.11.25
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS MRC C++ Class Library Help