LDialogImageEffect::DoModalUnderlay
#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 is shown in the following figure:
Required DLLs and Libraries
LTDLGIMGEFX 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
Example
void TestFunction(LBitmap * pBitmap, HWND hWnd)
{
LDialogImageEffect DlgImageEffect;
LDialogImageEffect::Initialize(DLG_INIT_COLOR );
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 L_FAR * ) malloc ( sizeof ( L_TCHAR ) * 20 );
Items [ 0 ].pBitmap = (pBITMAPHANDLE) malloc ( sizeof ( BITMAPHANDLE ) );
lstrcpy ( Items [ 0 ].pszFileName, TEXT("C:\\Patterns.bmp") ) ;
TmpBitmap.LoadResize(Items [ 0 ].pszFileName,
100,
0,
24,
0,
ORDER_BGR,
NULL,
NULL );
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);
DlgImageEffect.SetUnderlayParams(&DlgParams);
DlgImageEffect.DoModalUnderlay(hWnd);
// Gets the updated values for the structure
DlgImageEffect.GetUnderlayParams(&DlgParams, sizeof(DlgParams));
LDialogImageEffect::Free();
TmpBitmap.Free();
free ( Items [ 0 ].pszFileName );
free ( Items [ 0 ].pBitmap );
}