LDialogDocument::DoModalDotRemove

#include "ltwrappr.h"

virtual L_INT LDialogDocument::DoModalDotRemove(hWndOwner)

HWND hWndOwner;

handle of the window which owns the dialog

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

Parameter

Description

hWndOwner

Handle of the window which owns the dialog.

Returns

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::SetDotRemoveParams must be called before using this function to set the initial values for the dialog. You can get the updated DOTREMOVEDLGPARAMS with the values entered by the user through the dialog by using LDialogDocument::GetDotRemoveParams.

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

The Dot Remove dialog.

Required DLLs and Libraries

LTDLGIMGDOC
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTDIS
LTIMGUTL
LTIMGCOR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

LDialogBase::Initialize, LBitmap::DotRemove

Topics:

Using Imaging Common Dialog

Example

L_INT LDialogDocument_DoModalDotRemoveExample(LBitmap * pBitmap, HWND hWnd) 
{ 
   L_INT nRet; 
   LDialogDocument DlgDocument; 
   nRet = LDialogDocument::Initialize(0); 
   if(nRet != SUCCESS) 
      return nRet; 
   DlgDocument.SetBitmap(pBitmap); 
   LBitmap BitmapRegion; 
   DOTREMOVEDLGPARAMS DlgParams; 
   memset ( &DlgParams, 0, sizeof ( DOTREMOVEDLGPARAMS ) ) ; 
   nRet = BitmapRegion.Initialize (); 
   if(nRet != SUCCESS) 
      return nRet; 
   DlgParams.uStructSize      = sizeof ( DOTREMOVEDLGPARAMS ) ; 
   DlgParams.DotRemove.uStructSize         = sizeof ( DOTREMOVE ) ; 
   DlgParams.DotRemove.pBitmapRegion = BitmapRegion.GetHandle (); 
   DlgParams.DotRemove.uBitmapStructSize = sizeof ( BITMAPHANDLE ); 
   DlgParams.DotRemove.iMinDotWidth  = 1000 ; 
   DlgParams.DotRemove.iMinDotHeight = 1000 ; 
   DlgParams.DotRemove.iMaxDotWidth  = 1000 ; 
   DlgParams.DotRemove.iMaxDotHeight = 1000 ; 
   DlgParams.DotRemove.uFlags        = DOT_USE_DIAGONALS | DOT_USE_DPI ; 
   DlgDocument.EnableCallBack (FALSE); 
   DlgDocument.EnablePreview(TRUE); 
   DlgDocument.EnableAutoProcess(TRUE); 
   DlgDocument.EnableToolbar(TRUE); 
   nRet = DlgDocument.SetDotRemoveParams(&DlgParams) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = DlgDocument.DoModalDotRemove(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.GetDotRemoveParams(&DlgParams, sizeof(DlgParams)) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = LDialogDocument::Free(); 
   if(nRet != SUCCESS) 
      return nRet; 
   return nRet; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Common Dialog C++ Class Library Help