LDialogDocument::DoModalLineRemove

#include "ltwrappr.h"

virtual L_INT LDialogDocument::DoModalLineRemove(hWndOwner)

Displays the Line Remove dialog box, and gets the options for LBitmap::LineRemove. This function is available in the Document/MedicalDocument/Medical toolkits.

Parameters

HWND hWndOwner

Handle of the window which owns the dialog.

Returns

Value Meaning
SUCCESS_DLG_OK The "OK" button was pressed, and the dialog exited successfully.
SUCCESS_DLG_CANCEL The "Cancel" button was pressed, and the dialog exited successfully.
< 1 An error occurred. Refer to Return Codes.

Comments

LDialogDocument::SetLineRemoveParams must be called before using this function to set the initial values for the dialog. You can get the updated LINEREMOVEDLGPARAMS with the values entered by the user through the dialog by using LDialogDocument::GetLineRemoveParams.

The LBitmap::LineRemove function only works with 1-bit images. If you provide a bitmap in the LDialogDocument class, it must be a 1-bit bitmap.

The Line Remove dialog.
Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LDialogDocument_DoModalLineRemoveExample(LBitmap * pBitmap, HWND hWnd) 
{ 
   L_INT nRet; 
 
   LDialogDocument DlgDocument; 
 
   nRet = LDialogDocument::Initialize(0); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   DlgDocument.SetBitmap(pBitmap); 
 
   LBitmap BitmapRegion; 
 
   LINEREMOVEDLGPARAMS DlgParams;  
 
   nRet = BitmapRegion.Initialize (); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   memset ( &DlgParams, 0, sizeof ( LINEREMOVEDLGPARAMS ) ) ; 
 
   DlgParams.uStructSize      = sizeof ( LINEREMOVEDLGPARAMS ) ; 
   DlgParams.LineRemove.uStructSize           = sizeof ( LINEREMOVE ) ; 
   DlgParams.LineRemove.pBitmapRegion = BitmapRegion.GetHandle (); 
   DlgParams.LineRemove.uBitmapStructSize = sizeof ( BITMAPHANDLE ); 
   DlgParams.LineRemove.iGapLength      = 1 ; 
   DlgParams.LineRemove.iMaxLineWidth   = 2 ; 
   DlgParams.LineRemove.iMaxWallPercent = 3 ; 
   DlgParams.LineRemove.iMinLineLength  = 4 ; 
   DlgParams.LineRemove.iVariance       = 5 ; 
   DlgParams.LineRemove.iWall           = 6 ; 
   DlgParams.LineRemove.uFlags          = LINE_USE_DPI | LINE_USE_VARIANCE ; 
   DlgParams.LineRemove.uRemoveFlags    = LINEREMOVE_VERTICAL ; 
 
   DlgDocument.EnableCallBack (FALSE); 
   DlgDocument.EnablePreview(TRUE); 
   DlgDocument.EnableAutoProcess(TRUE); 
   DlgDocument.EnableToolbar(TRUE); 
 
   nRet = DlgDocument.SetLineRemoveParams(&DlgParams) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = DlgDocument.DoModalLineRemove(hWnd); 
   if(nRet < 1) 
      return nRet; 
 
   if(BitmapRegion.HasRgn()) 
   { 
      nRet = BitmapRegion.Region()->Free(); 
      if(nRet != SUCCESS) 
         return nRet; 
   } 
 
   // Gets the updated values for the structure 
   nRet = DlgDocument.GetLineRemoveParams(&DlgParams, sizeof(DlgParams)) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = LDialogDocument::Free(); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return nRet; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Common Dialog C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.