Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
LDialogImage::DoModalAddBorder
#include "ltwrappr.h"
virtual L_INT LDialogImage::DoModalAddBorder(hWndOwner)
HWND hWndOwner; |
/* handle of the window which owns the dialog */ |
Displays the Add Border dialog box, and gets the options for LBitmap::AddBorder .
Parameter |
Description |
hWndOwner |
Handle of the window which owns the dialog. |
Returns
SUCCESS_DLG_CLOSE |
The dialog exits successfully after pressing the "Close" button. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
LDialogImage::SetAddBorderParams must be called before using this function to set the initial values for the dialog. You can get the updated ADDBORDERDLGPARAMS with the values entered by the user through the dialog by using LDialogImage::GetAddBorderParams.
The Add Border dialog.
Required DLLs and Libraries
LTDLGIMG 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: |
LBase::EnableCallBack , LDialogBase::EnablePreview, LDialogBase::EnableAutoProcess, LDialogBase::EnableToolbar, LDialogBase::Free, LDialogBase::Initialize, LDialogImage::SetAddBorderParams, LDialogImage::GetAddBorderParams, LBitmap::AddBorder , Class Members |
Topics: |
Example
L_INT ShowAddBorderDlg ( HWND hWnd, LBitmap* pBitmap, LPDLGBITMAPLIST pList) { L_INT nRet = 0; LDialogImage DlgImage; DlgImage.SetBitmap(pBitmap); nRet = LDialogImage::Initialize(0); if(nRet != SUCCESS) return nRet; ADDBORDERDLGPARAMS DlgParams ; memset ( &DlgParams, 0, sizeof ( ADDBORDERDLGPARAMS ) ) ; DlgParams.uStructSize = sizeof ( ADDBORDERDLGPARAMS ) ; DlgParams.pBitmapList = pList ; DlgImage.EnableCallBack (FALSE); DlgImage.EnablePreview(TRUE); DlgImage.EnableAutoProcess(TRUE); DlgImage.EnableToolbar(TRUE); nRet = DlgImage.SetAddBorderParams(&DlgParams) ; if(nRet != SUCCESS) return nRet; nRet = DlgImage.DoModalAddBorder(hWnd); if(nRet < 1) return nRet; // Gets the updated values for the structure nRet = DlgImage.GetAddBorderParams(&DlgParams, sizeof(DlgParams)) ; if(nRet != SUCCESS) return nRet; nRet = LDialogImage::Free(); if(nRet != SUCCESS) return nRet; return SUCCESS; } L_INT LDialogImage_DoModalAddBorderExample( HWND hWnd, LBitmap * pBitmap, L_TCHAR* pszTileImage ) { L_INT nRet; DLGBITMAPLISTITEM Items [ 1 ] ; DLGBITMAPLIST bmplist ; LBitmap BorderBitmap; Items [ 0 ].pszDescription = NULL ; Items [ 0 ].pszFileName = pszTileImage ; nRet = BorderBitmap.Initialize (); if(nRet != SUCCESS) return nRet; nRet = BorderBitmap.LoadResize (Items [ 0 ].pszFileName, 100, 0, 24, 0, ORDER_BGR, NULL, NULL ) ; if(nRet != SUCCESS) return nRet; Items [ 0 ].pBitmap = BorderBitmap.GetHandle (); bmplist.uStructSize = sizeof ( DLGBITMAPLIST ) ; bmplist.pBitmapList = Items ; bmplist.nCount = 1 ; nRet = ShowAddBorderDlg ( hWnd, pBitmap, &bmplist ) ; if(nRet != SUCCESS) return nRet; nRet = BorderBitmap.Free (); if(nRet != SUCCESS) return nRet; return SUCCESS; }