LDialogImageEffect::DoModalStitch

#include "ltwrappr.h"

virtual L_INT LDialogImageEffect::DoModalStitch(hWndOwner)

HWND hWndOwner;

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

Displays the Stitch dialog box for composing images. Use this dialog to produce a new bitmap that is composed of 1 or more source bitmaps.

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::SetStitchParams must be called before using this function to set the initial values for the dialog. You can get the updated STITCHDLGPARAMS with the values entered by the user through the dialog by using LDialogImageEffect::GetStitchParams.

The Stitch dialog.

Required DLLs and Libraries

LTDLGIMGEFX
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTDIS
LTIMGUTL
LTIMGEFX

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:

LDialogBase::Initialize, LBase::EnableCallBack , LDialogBase::EnablePreview, LDialogBase::EnableAutoProcess, LDialogBase::EnableToolbar, LDialogBase::Free, LDialogImageEffect::GetStitchParams, LDialogImageEffect::SetStitchParams

Topics:

Using Imaging Common Dialog

Example

L_INT ShowStitchDialog(HWND hWnd, LPDLGBITMAPLIST pList, LBitmap* pResultBitmap)
{
   L_INT nRet = 0;
   LDialogImageEffect DlgImageEffect;
   DlgImageEffect.SetBitmap(pResultBitmap);
   nRet = LDialogImageEffect::Initialize(0);
   if(nRet != SUCCESS)
      return nRet;
   STITCHDLGPARAMS DlgParams;
   memset ( &DlgParams, 0, sizeof ( STITCHDLGPARAMS ) );
   DlgParams.uStructSize                  = sizeof ( STITCHDLGPARAMS );
   DlgParams.nResultingBitmapWidth        = 320;
   DlgParams.nResultingBitmapHeight       = 200;
   DlgParams.nResultingBitmapBitsPerPixel = 24;
   DlgParams.nRes                         = 72;
   DlgParams.crBackGround                 = RGB ( 255, 255, 255 );
   DlgParams.pBitmapList                  = pList;
   DlgParams.hWindowIcon                  = NULL;
   DlgParams.nCmdShow                     = SW_SHOW;
   DlgImageEffect.EnableCallBack (FALSE);
   nRet = DlgImageEffect.SetStitchParams(&DlgParams);
   if(nRet != SUCCESS)
      return nRet;
   nRet = DlgImageEffect.DoModalStitch(hWnd);
   if(nRet < 1)
      return nRet;
   // Gets the updated values for the structure
   nRet = DlgImageEffect.GetStitchParams(&DlgParams, sizeof(DlgParams));
   if(nRet != SUCCESS)
      return nRet;
   nRet = LDialogImageEffect::Free();
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}
L_INT LDialogImageEffect_DoModalStitchExample( HWND hWnd, LBitmap* pBitmap, LBitmap* pResultBitmap)
{
   L_INT             nRet;
   DLGBITMAPLISTITEM Items [ 1 ];
   DLGBITMAPLIST     bmplist;
   Items [ 0 ].pszDescription    = NULL;
   Items [ 0 ].pszFileName       = NULL;
   Items [ 0 ].pBitmap           = pBitmap->GetHandle ();
   bmplist.uStructSize = sizeof ( DLGBITMAPLIST );
   bmplist.pBitmapList = Items;
   bmplist.nCount      = 1;
   nRet = ShowStitchDialog ( hWnd, &bmplist, pResultBitmap );
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}