LDialogImage::DoModalAddFrame

#include "ltwrappr.h"

virtual L_INT LDialogImage::DoModalAddFrame(hWndOwner)

Displays the Add Frame dialog box, and gets the options for LBitmap::AddFrame.

Parameters

HWND hWndOwner

Handle of the window which owns the dialog.

Returns

Value Meaning
SUCCESS_DLG_CLOSE The dialog exits successfully after pressing the "Close" button.
< 1 An error occurred. Refer to Return Codes.

Comments

LDialogImage::SetAddFrameParams must be called before using this function to set the initial values for the dialog. You can get the updated ADDFRAMEDLGPARAMS with the values entered by the user through the dialog by using LDialogImage::GetAddFrameParams.

The Add Frame dialog.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT ShowAddFrameDlg (HWND hWnd, LBitmap* pBitmap, LPDLGBITMAPLIST pList) 
{ 
   L_INT nRet = 0; 
 
   LDialogImage DlgImage; 
 
   DlgImage.SetBitmap(pBitmap); 
 
   nRet = LDialogImage::Initialize(0); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   ADDFRAMEDLGPARAMS DlgParams ; 
 
   memset ( &DlgParams, 0, sizeof ( ADDFRAMEDLGPARAMS ) ) ; 
 
   DlgParams.uStructSize = sizeof ( ADDFRAMEDLGPARAMS ) ; 
   DlgParams.pBitmapList = pList ; 
 
   DlgImage.EnableCallBack (FALSE); 
   DlgImage.EnablePreview(TRUE); 
   DlgImage.EnableAutoProcess(TRUE); 
   DlgImage.EnableToolbar(TRUE); 
 
   nRet = DlgImage.SetAddFrameParams(&DlgParams) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = DlgImage.DoModalAddFrame(hWnd); 
   if(nRet < 1) 
      return nRet; 
 
   // Gets the updated values for the structure 
   nRet = DlgImage.GetAddFrameParams(&DlgParams, sizeof(DlgParams)) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = LDialogImage::Free(); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
 
L_INT LDialogImage_DoModalAddFrameExample( HWND hWnd, LBitmap* pBitmap, L_TCHAR* pszTileImage ) 
{ 
   L_INT                nRet; 
   DLGBITMAPLISTITEM    Items [ 1 ] ; 
   DLGBITMAPLIST        bmplist ; 
   LBitmap              FrameBitmap; 
 
   Items [ 0 ].pszDescription  = NULL ; 
   Items [ 0 ].pszFileName     = pszTileImage ; 
 
   nRet = FrameBitmap.Initialize (); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = FrameBitmap.LoadResize ( Items [ 0 ].pszFileName, 
                        100, 
                        0, 
                        24, 
                        0, 
                        ORDER_BGR, 
                        NULL, 
                        NULL ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   Items [ 0 ].pBitmap = FrameBitmap.GetHandle (); 
 
   bmplist.uStructSize = sizeof ( DLGBITMAPLIST ) ; 
   bmplist.pBitmapList = Items ; 
   bmplist.nCount      = 1 ; 
 
   nRet = ShowAddFrameDlg ( hWnd, pBitmap, &bmplist ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = FrameBitmap.Free (); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Common Dialog C++ Class Library Help