L_DlgAddBitmaps

Summary

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

Syntax

#include "l_bitmap.h"

L_LTDLG_API L_INT L_DlgAddBitmaps (hWndOwner, pDlgParams)

Parameters

L_HWND hWndOwner

Handle of the window which owns the dialog.

LPADDBITMAPSDLGPARAMS pDlgParams

Pointer to an 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 dialogs initial values.

Returns

Value Meaning
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.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT DLGAddBitmapsExample(HWND hWnd,pBITMAPHANDLE   pResultedBitmap) 
{ 
   L_INT nRet; 
   ADDBITMAPSDLGPARAMS DlgParams ; 
   DLGBITMAPLISTITEM   BitmapListItems [ 3 ] ; 
   DLGBITMAPLIST       BitmapList ; 
   L_INT               i ;  
 
   memset ( &DlgParams, 0, sizeof ( ADDBITMAPSDLGPARAMS ) ) ;  
   memset ( &BitmapListItems, 0, sizeof ( DLGBITMAPLISTITEM ) * 3 ) ;  
   memset ( &BitmapList, 0, sizeof ( DLGBITMAPLIST ) ) ;  
 
   // ITEM (1)  
   BitmapListItems [ 0 ].pszDescription = ( L_TCHAR* ) malloc ( sizeof ( L_TCHAR ) * L_MAXPATH ) ; 
   BitmapListItems [ 0 ].pBitmap     = ( pBITMAPHANDLE ) malloc ( sizeof ( BITMAPHANDLE ) ) ; 
 
   lstrcpy ( BitmapListItems [ 0 ].pszDescription,MAKE_IMAGE_PATH(TEXT("IMAGE1.CMP")) ) ; 
 
   nRet = L_LoadBitmap(MAKE_IMAGE_PATH(TEXT("IMAGE1.CMP")), 
                BitmapListItems [ 0 ].pBitmap, 
                sizeof ( BITMAPHANDLE ), 
                LOADFILE_ALLOCATE | LOADFILE_STORE | LOADFILE_COMPRESSED, 
                ORDER_BGR, 
                NULL, 
                NULL ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   // ITEM (2)  
   BitmapListItems [ 1 ].pszDescription = ( L_TCHAR* ) malloc ( sizeof ( L_TCHAR ) * L_MAXPATH ) ;  
   BitmapListItems [ 1 ].pBitmap     = ( pBITMAPHANDLE ) malloc ( sizeof ( BITMAPHANDLE ) ) ;  
 
   lstrcpy ( BitmapListItems [ 1 ].pszDescription,MAKE_IMAGE_PATH(TEXT("IMAGE2.CMP"))) ; 
   nRet = L_LoadBitmap (MAKE_IMAGE_PATH(TEXT("IMAGE2.CMP")), 
                 BitmapListItems [ 1 ].pBitmap, 
                 sizeof ( BITMAPHANDLE ), 
                 LOADFILE_ALLOCATE | LOADFILE_STORE | LOADFILE_COMPRESSED, 
                 ORDER_BGR, 
                 NULL, 
                 NULL ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   // ITEM (3)  
   BitmapListItems [ 2 ].pszDescription = ( L_TCHAR* ) malloc ( sizeof ( L_TCHAR ) * L_MAXPATH ) ; 
   BitmapListItems [ 2 ].pBitmap     = ( pBITMAPHANDLE ) malloc ( sizeof ( BITMAPHANDLE ) ) ; 
 
   lstrcpy ( BitmapListItems [ 2 ].pszDescription,MAKE_IMAGE_PATH(TEXT("IMAGE2.CMP"))) ; 
   nRet = L_LoadBitmap(MAKE_IMAGE_PATH(TEXT("IMAGE2.CMP")), 
                BitmapListItems [ 2 ].pBitmap, 
                sizeof ( BITMAPHANDLE ), 
                LOADFILE_ALLOCATE | LOADFILE_STORE | LOADFILE_COMPRESSED, 
                ORDER_BGR, 
                NULL, 
                NULL ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   BitmapList.nCount      = 3 ; 
   BitmapList.pBitmapList = ( LPDLGBITMAPLISTITEM ) &BitmapListItems ; 
 
   DlgParams.uStructSize      = sizeof(ADDBITMAPSDLGPARAMS); 
   DlgParams.pBitmap          = pResultedBitmap ; 
   DlgParams.pBitmapList      = &BitmapList ; 
   DlgParams.uAddBitmapsFlags = BC_AVG ; 
   DlgParams.uDlgFlags        = DLG_ADDBITMAPS_AUTOPROCESS        | 
                                DLG_ADDBITMAPS_SHOW_PREVIEW       | 
                                DLG_ADDBITMAPS_SHOW_TOOL_ZOOMLEVEL; 
       
   nRet = L_DlgInit ( DLG_INIT_COLOR ) ; 
   if(nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) 
      return nRet; 
   nRet = L_DlgAddBitmaps ( hWnd, &DlgParams ) ; 
   if(nRet < 1) 
      return nRet; 
   nRet = L_DlgFree () ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Clean up memory 
   for ( i = 0; i < 3; i++ )  
   { 
      if ( NULL != BitmapListItems [ i ].pBitmap ) 
      { 
         free ( BitmapListItems [ i ].pBitmap ) ; 
      } 
       
      if ( NULL != BitmapListItems [ i ].pszDescription ) 
      { 
         free ( BitmapListItems [ i ].pszDescription ) ; 
      } 
   } 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Common Dialog C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.