LDialogDocument::DoModalHolePunchRemove

#include "ltwrappr.h"

virtual L_INT LDialogDocument::DoModalHolePunchRemove(hWndOwner)

HWND hWndOwner;

/* handle of the window which owns the dialog*/

Displays the Hole Punch Remove box, and gets the options for LBitmap::HolePunchRemove. This function is available in the Document/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::SetHolePunchRemoveParams must be called before using this function to set the initial values for the dialog. You can get the updated HOLEPUNCHREMOVEDLGPARAMS with the values entered by the user through the dialog by using LDialogDocument::GetHolePunchRemoveParams.

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

The Hole Punch Remove dialog is shown in the following figure:

image\HolePunchRemove.gif

Required DLLs and Libraries

LTDLGIMGDOC
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTDIS
LTIMG

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::HolePunchRemove

Topics:

Using Imaging Common Dialog

Example

void TestFunction(LBitmap * pBitmap, HWND hWnd)
{
   LDialogDocument DlgDocument;
   LDialogDocument::Initialize(0);
   DlgDocument.SetBitmap(pBitmap);
   LBitmap BitmapRegion;

   HOLEPUNCHREMOVEDLGPARAMS DlgParams; 

   memset ( &DlgParams, 0, sizeof ( HOLEPUNCHREMOVEDLGPARAMS ) ) ;
   BitmapRegion.Initialize();

   DlgParams.uStructSize      = sizeof ( HOLEPUNCHREMOVEDLGPARAMS ) ;
   DlgParams.HolePunchRemove.uStructSize          = sizeof ( HOLEPUNCH ) ;
   DlgParams.HolePunchRemove.pBitmapRegion = BitmapRegion.GetHandle();
   DlgParams.HolePunchRemove.uBitmapStructSize = sizeof ( BITMAPHANDLE );
   DlgParams.HolePunchRemove.iMinHoleWidth  = 1000 ;
   DlgParams.HolePunchRemove.iMinHoleHeight = 1000 ;
   DlgParams.HolePunchRemove.iMaxHoleWidth  = 1000 ;
   DlgParams.HolePunchRemove.iMaxHoleHeight = 1000 ;
   DlgParams.HolePunchRemove.iMinHoleCount  = 2 ;
   DlgParams.HolePunchRemove.iMaxHoleCount  = 4 ;
   DlgParams.HolePunchRemove.uFlags         = HOLEPUNCH_USE_DPI ;
   DlgParams.HolePunchRemove.iLocation      = HOLEPUNCH_RIGHT ;

   DlgDocument.EnableCallBack(FALSE);
   DlgDocument.EnablePreview(TRUE);
   DlgDocument.EnableAutoProcess(TRUE);
   DlgDocument.EnableToolbar(TRUE);
   DlgDocument.SetHolePunchRemoveParams(&DlgParams) ;
   DlgDocument.DoModalHolePunchRemove(hWnd);
   if(BitmapRegion.HasRgn())
      BitmapRegion.Region()->Free();

   // Gets the updated values for the structure
   DlgDocument.GetHolePunchRemoveParams(&DlgParams, sizeof(DlgParams)) ;
   LDialogDocument::Free();
}