Displays the Underlay dialog box, and gets the options for L_UnderlayBitmap.
#include "l_bitmap.h"
L_LTDLG_API L_INT L_DlgUnderlay(hWndOwner, pDlgParams)
Handle of the window which owns the dialog.
Pointer to an UNDERLAYDLGPARAMS structure to be updated with the values entered by the user, through the dialog. Set members of this structure, before calling this function, to set the dialogs initial values.
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. |
L_INT DLGUnderlayExample(HWND hWnd,pBITMAPHANDLE pBitmap)
{
L_INT nRet;
UNDERLAYDLGPARAMS DlgParam ;
DLGBITMAPLISTITEM Items [ 1 ] ;
DLGBITMAPLIST BitmapList ;
memset ( &DlgParam, 0, sizeof ( UNDERLAYDLGPARAMS ) ) ;
Items [ 0 ].pszFileName = ( L_TCHAR* ) malloc ( sizeof ( L_TCHAR ) * L_MAXPATH ) ;
Items [ 0 ].pBitmap = (pBITMAPHANDLE) malloc ( sizeof ( BITMAPHANDLE ) );
lstrcpy ( Items [ 0 ].pszFileName,MAKE_IMAGE_PATH(TEXT("ULAY1.BMP"))) ;
nRet = L_LoadBitmapResize(Items [ 0 ].pszFileName,
Items [ 0 ].pBitmap,
sizeof( BITMAPHANDLE ),
100,
0,
24,
0,
ORDER_BGR,
NULL,
NULL ) ;
if(nRet != SUCCESS)
return nRet;
BitmapList.uStructSize = sizeof ( DLGBITMAPLIST ) ;
BitmapList.pBitmapList = Items ;
BitmapList.nCount = 1 ;
DlgParam.uStructSize = sizeof ( UNDERLAYDLGPARAMS ) ;
DlgParam.pBitmap = pBitmap ;
DlgParam.uDlgFlags = DLG_UNDERLAY_AUTOPROCESS |
DLG_UNDERLAY_SHOW_PREVIEW |
DLG_UNDERLAY_SHOW_TOOL_ZOOMLEVEL;
DlgParam.uUnderlayFlags = UB_TILE ;
DlgParam.nUnderlayBitmapIndex = 0 ;
DlgParam.pBitmapList = &BitmapList ;
nRet = L_DlgInit ( DLG_INIT_COLOR ) ;
if(nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED)
return nRet;
nRet = L_DlgUnderlay (hWnd, &DlgParam ) ;
if(nRet < 1)
return nRet;
nRet = L_DlgFree () ;
if(nRet != SUCCESS)
return nRet;
L_FreeBitmap( Items [ 0 ].pBitmap ) ;
free ( Items [ 0 ].pszFileName ) ;
free ( Items [ 0 ].pBitmap ) ;
return SUCCESS;
}