Products | Support | Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS Common Dialog C++ Class Library Help

LDialogImageEffect::DoModalUnderlay

Show in webframe

#include "ltwrappr.h"

virtual L_INT LDialogImageEffect::DoModalUnderlay(hWndOwner)

HWND hWndOwner;

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

Displays the Underlay dialog box, and gets the options for LBitmapBase::Underlay.

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

LDialogImageEffect::SetUnderlayParams must be called before using this function to set the initial values for the dialog. You can get the updated UNDERLAYDLGPARAMS with the values entered by the user through the dialog by using LDialogImageEffect::GetUnderlayParams.

The Underlay dialog.

Required DLLs and Libraries

LTDLGIMGEFX
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTDIS
LTIMGUTL
LTIMGEFX

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, LBitmapBase::Underlay, LBase::EnableCallBack, LDialogBase::EnablePreview, LDialogBase::EnableAutoProcess, LDialogBase::EnableToolbar, LDialogBase::Free, LDialogImageEffect::SetUnderlayParams, LDialogImageEffect::GetUnderlayParams

Topics:

Using Imaging Common Dialog

Example

#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName
L_INT LDialogImageEffect_DoModalUnderlayExample(LBitmap * pBitmap, HWND hWnd)
{
   L_INT nRet;
   LDialogImageEffect DlgImageEffect;
   nRet = LDialogImageEffect::Initialize(DLG_INIT_COLOR );
   if(nRet != SUCCESS)
      return nRet;
   DlgImageEffect.SetBitmap(pBitmap);
   UNDERLAYDLGPARAMS DlgParams; 
   DLGBITMAPLISTITEM Items [ 1 ];
   DLGBITMAPLIST     BitmapList;
   LBitmap TmpBitmap;
   memset ( &DlgParams, 0, sizeof ( UNDERLAYDLGPARAMS ) );
   DlgParams. uStructSize = sizeof ( UNDERLAYDLGPARAMS );
   Items [ 0 ].pszFileName  = ( L_TCHAR * ) malloc ( sizeof ( L_TCHAR ) * L_MAXPATH );
   lstrcpy ( Items [ 0 ].pszFileName, MAKE_IMAGE_PATH(TEXT("ULAY1.BMP") ) );
   nRet = TmpBitmap.LoadResize (Items [ 0 ].pszFileName,
                        100,
                        0,
                        24,
                        0,
                        ORDER_BGR,
                        NULL,
                        NULL );
   if(nRet != SUCCESS)
      return nRet;
   Items [ 0 ].pBitmap = TmpBitmap.GetHandle ();
   BitmapList.uStructSize  = sizeof ( DLGBITMAPLIST );
   BitmapList.pBitmapList = Items;
   BitmapList.nCount      = 1;
   DlgParams.uUnderlayFlags       = UB_TILE;
   DlgParams.nUnderlayBitmapIndex = 0;
   DlgParams.pBitmapList          = &BitmapList;
   DlgImageEffect.EnableCallBack (FALSE);
   DlgImageEffect.EnablePreview(TRUE);
   DlgImageEffect.EnableAutoProcess(TRUE);
   DlgImageEffect.EnableToolbar(TRUE);
   nRet = DlgImageEffect.SetUnderlayParams(&DlgParams);
   if(nRet != SUCCESS)
      return nRet;
   nRet = DlgImageEffect.DoModalUnderlay(hWnd); 
   if(nRet < 1)
      return nRet;
   // Gets the updated values for the structure
   nRet = DlgImageEffect.GetUnderlayParams(&DlgParams, sizeof(DlgParams));
   if(nRet != SUCCESS)
      return nRet;
   nRet = LDialogImageEffect::Free();
   if(nRet != SUCCESS)
      return nRet;
   nRet = TmpBitmap.Free();
   if(nRet != SUCCESS)
      return nRet;
   free ( Items [ 0 ].pszFileName );
   return SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.