L_DlgAddBitmaps

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DlgAddBitmaps (hWndOwner, pDlgParams)

HWND hWndOwner;

/* owner of dialog */

LPADDBITMAPSDLGPARAMS pDlgParams;

/* pointer to a structure */

Displays the Add Bitmaps dialog box, and gets the options for L_AddBitmaps.

Parameter

Description

hWndOwner

Handle of the window which owns the dialog.

pDlgParams

Pointer to a ADDBITMAPSDLGPARAMS 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 dialog’s initial values.

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

The Add Bitmaps dialog can be seen below:

image\AddBitmaps.gif

Required DLLs and Libraries

LTDLGIMGEFX
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTDIS
LTIMG
LTKRN

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:

L_DlgInit, L_AddBitmaps

Topics:

Dialogs: Artistic Effects

 

Using Imaging Common Dialog

Example

L_VOID ShowDialog ( HWND hWnd, pBITMAPHANDLE pResultedBitmap ) 
{
   ADDBITMAPSDLGPARAMS DlgParams ; 
   DLGBITMAPLISTITEM   BitmapListItems [ 3 ] ; 
   DLGBITMAPLIST       BitmapList ; 
   L_INT               i ; 


   memset ( &DlgParams, 0, sizeof ( ADDBITMAPSDLGPARAMS ) ) ; 

   // ITEM (1) 
   BitmapListItems [ 0 ].pszFileName = ( L_TCHAR L_FAR * ) malloc ( sizeof ( L_TCHAR ) * 20 ) ; 
   BitmapListItems [ 0 ].pBitmap    = ( pBITMAPHANDLE ) malloc ( sizeof ( BITMAPHANDLE ) ) ; 

   lstrcpy ( BitmapListItems [ 0 ].pszFileName, TEXT("C:\\sample1.cmp") ) ; 
   L_LoadBitmap( TEXT("C:\\sample1.cmp"), 
                  BitmapListItems [ 0 ].pBitmap, 
                  sizeof ( BITMAPHANDLE ),
                  LOADFILE_ALLOCATE | LOADFILE_STORE | LOADFILE_COMPRESSED, 
                  ORDER_BGR, 
                  NULL, 
                  NULL ) ; 

   // ITEM (2) 
   BitmapListItems [ 1 ].pszFileName = ( L_TCHAR L_FAR * ) malloc ( sizeof ( L_TCHAR ) * 20 ) ; 
   BitmapListItems [ 1 ].pBitmap    = ( pBITMAPHANDLE ) malloc ( sizeof ( BITMAPHANDLE ) ) ; 
   
   lstrcpy ( BitmapListItems [ 1 ].pszFileName, TEXT("C:\\sample2.cmp") ) ; 
   L_LoadBitmap ( TEXT("C:\\sample2.cmp"), 
                  BitmapListItems [ 1 ].pBitmap, 
                  sizeof ( BITMAPHANDLE ),
                  LOADFILE_ALLOCATE | LOADFILE_STORE | LOADFILE_COMPRESSED, 
                  ORDER_BGR, 
                  NULL, 
                  NULL ) ; 

   // ITEM (3) 
   BitmapListItems [ 2 ].pszFileName = ( L_TCHAR L_FAR * ) malloc ( sizeof ( L_TCHAR ) * 20 ) ; 
   BitmapListItems [ 2 ].pBitmap    = ( pBITMAPHANDLE ) malloc ( sizeof ( BITMAPHANDLE ) ) ; 
   
   lstrcpy ( BitmapListItems [ 2 ].pszFileName, TEXT("C:\\sample3.cmp") ) ; 
   L_LoadBitmap( TEXT("C:\\sample3.cmp"), 
                  BitmapListItems [ 2 ].pBitmap, 
                  sizeof ( BITMAPHANDLE ),
                  LOADFILE_ALLOCATE | LOADFILE_STORE | LOADFILE_COMPRESSED, 
                  ORDER_BGR, 
                  NULL, 
                  NULL ) ; 

   BitmapList.nCount      = 3 ; 
   BitmapList.pBitmapList = ( LPDLGBITMAPLISTITEM ) &BitmapListItems ; 

   DlgParams.pBitmap          = pResultedBitmap ; 
   DlgParams.pBitmapList      = &BitmapList ; 
   DlgParams.uAddBitmapsFlags = BC_AVG ; 
   DlgParams.uDlgFlags        = DLG_ADDBITMAPS_AUTOPROCESS | 
                                DLG_ADDBITMAPS_SHOW_PREVIEW | 
                                DLG_ADDBITMAPS_SHOW_TOOL_ZOOMLEVEL ; 
      
   L_DlgInit ( 0 ) ; 
   L_DlgAddBitmaps ( hWnd, &DlgParams ) ; 
   L_DlgFree ( ) ; 

   // Clean up memory
   for ( i = 0; i < 3; i++ ) 
   {
      if ( NULL != BitmapListItems [ i ].pBitmap ) 
      {
         free ( BitmapListItems [ i ].pBitmap ) ; 
      }
      
      if ( NULL != BitmapListItems [ i ].pszFileName ) 
      {
         free ( BitmapListItems [ i ].pszFileName ) ; 
      }
   }
}