LDialogImage::DoModalAddFrame

#include "ltwrappr.h"

virtual L_INT LDialogImage::DoModalAddFrame(hWndOwner)

HWND hWndOwner;

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

Displays the Add Frame dialog box, and gets the options for LBitmap::AddFrame. This function is available in the Raster Pro and above toolkits.

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::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 is shown in the following figure:

image\AddFrame.gif

Required DLLs and Libraries

LTDLGIMG
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTDIS
LTIMG

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::SetAddFrameParams, LDialogImage::GetAddFrameParams, LBitmap::AddFrame, LDialogImage::DoModalAddBorder, Class Members

Topics:

Using Imaging Common Dialog

Example

L_VOID ShowAddFrameDlg 

   HWND                  hWnd, 
   LBitmap*         pBitmap, 
   LPDLGBITMAPLIST pList
)
{

   L_INT nRet = 0;
   LDialogImage DlgImage;

   DlgImage.SetBitmap(pBitmap);
   LDialogImage::Initialize(0);

   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);
   DlgImage.SetAddFrameParams(&DlgParams) ;
   nRet = DlgImage.DoModalAddFrame(hWnd);
   // Gets the updated values for the structure
   DlgImage.GetAddFrameParams(&DlgParams, sizeof(DlgParams)) ;

   LDialogImage::Free();
}

L_VOID DoAddFrameSingleTile

   HWND hWnd, 
   LBitmap* pBitmap, 
   L_TCHAR* pszTileImage 
)
{
   DLGBITMAPLISTITEM Items [ 1 ] ;
   DLGBITMAPLIST     bmplist ;
   LBitmap FrameBitmap;
   Items [ 0 ].pszDescription  = NULL ;
   Items [ 0 ].pszFileName = pszTileImage ;
   FrameBitmap.Initialize();
   FrameBitmap.LoadResize( Items [ 0 ].pszFileName,
                        100,
                        0,
                        24,
                        0,
                        ORDER_BGR,
                        NULL,
                        NULL ) ;

   Items [ 0 ].pBitmap    = FrameBitmap.GetHandle();
   bmplist.uStructSize = sizeof ( DLGBITMAPLIST ) ;
   bmplist.pBitmapList = Items ;
   bmplist.nCount      = 1 ;

   ShowAddFrameDlg ( hWnd, pBitmap, &bmplist ) ;

   FrameBitmap.Free();

}