L_DlgJPEGWebTuner

#include "l_bitmap.h"

L_LTDLG_API L_INT L_DlgJPEGWebTuner(hWndOwner, pDlgParams)

Displays the JPEG Web Tuner dialog box, and gets the tuning options used by L_SaveBitmap.

Parameters

L_HWND hWndOwner

Handle of the window, which owns the dialog.

LPJPEGWEBTUNERDLGPARAMS pDlgParams

Pointer to a JPEGWEBTUNERDLGPARAMS 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.

Comments

The JPEG Web Tuner dialog.

Returns

Value Meaning
SUCCESS_DLG_OK The "OK" button was pressed, and the dialog exited successfully.
SUCCESS_DLG_CLOSE The "Close" 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.

Required DLLs and Libraries

See Also

Functions

Topics

Example

// Example 1: 
L_INT DlgJPEGWebTunerFirstExample(HWND hWnd,pBITMAPHANDLE  pBitmap) 
{ 
   L_INT nRet; 
   JPEGWEBTUNERDLGPARAMS DlgParams ; 
 
   memset ( &DlgParams, 0, sizeof ( JPEGWEBTUNERDLGPARAMS ) ) ; 
 
   DlgParams.uStructSize   = sizeof ( JPEGWEBTUNERDLGPARAMS ) ; 
   DlgParams.pBitmap       = pBitmap ; 
   DlgParams.uDlgFlags     = DLG_JPEGWEBTUNER_SHOW_EXPORT         | 
                             DLG_JPEGWEBTUNER_SHOW_INFORMATION    | 
                             DLG_JPEGWEBTUNER_SHOW_PREVIEW        | 
                             DLG_JPEGWEBTUNER_SHOW_TOOL_ZOOMLEVEL | 
                             DLG_JPEGWEBTUNER_SHOW_SAVETHUMBNAIL  | 
                             DLG_JPEGWEBTUNER_SHOW_OPTIONS        | 
                             DLG_JPEGWEBTUNER_SHOW_SAVETHUMBNAIL  ; 
 
   nRet = L_DlgInit ( DLG_INIT_COLOR ) ; 
   if(nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) 
      return nRet; 
   nRet = L_DlgJPEGWebTuner ( hWnd, &DlgParams ) ; 
   if(nRet < 1) 
      return nRet; 
   nRet = L_DlgFree () ; 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 
 
// Example 2: 
static L_VOID  ExportBitmap (L_TCHAR*                szFileName, 
                            pBITMAPHANDLE           pBitmap, 
                            LPJPEGWEBTUNERDLGPARAMS pParam) 
{ 
   {// SAVE TO DISK 
      SAVEFILEOPTION SaveOption ; 
 
      memset ( &SaveOption, 0, sizeof ( SAVEFILEOPTION ) ) ; 
 
      if ( pParam->bProgressive ) 
      { 
         SaveOption.Passes = -1 ; 
      } 
 
      if ( pParam->bWithStamp ) 
      {        
         SaveOption.Flags       |=  ESO_JPEGSTAMP | ESO_SAVEWITHSTAMP ; 
         SaveOption.StampWidth  = 32 ; 
         SaveOption.StampHeight = 32 ; 
         SaveOption.StampBits   = 24 ; 
      } 
 
      L_SaveBitmap ( szFileName,  
                     pBitmap,  
                     pParam->nFormat,  
                     24,  
                     pParam->nQuality,  
                     &SaveOption ) ; 
 
   }// SAVE TO DISK 
} 
 
L_INT DlgJPEGWebTunerSecondExample(HWND hWnd,pBITMAPHANDLE pBitmap) 
{ 
   L_INT                   nRet ; 
   JPEGWEBTUNERDLGPARAMS   DlgParams ; 
 
   memset ( &DlgParams, 0, sizeof ( JPEGWEBTUNERDLGPARAMS ) ) ; 
 
   DlgParams.uStructSize   = sizeof ( JPEGWEBTUNERDLGPARAMS ) ; 
   DlgParams.pBitmap       = pBitmap ; 
   DlgParams.uDlgFlags     = DLG_JPEGWEBTUNER_SHOW_INFORMATION    | 
                             DLG_JPEGWEBTUNER_SHOW_PREVIEW        | 
                             DLG_JPEGWEBTUNER_SHOW_TOOL_ZOOMLEVEL | 
                             DLG_JPEGWEBTUNER_SHOW_SAVETHUMBNAIL  | 
                             DLG_JPEGWEBTUNER_SHOW_OPTIONS        ; 
 
   nRet = L_DlgInit ( DLG_INIT_COLOR ) ; 
   if(nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED) 
      return nRet; 
   nRet = L_DlgJPEGWebTuner (hWnd, &DlgParams) ; 
 
   if ( SUCCESS_DLG_OK == nRet ) 
   { 
      ExportBitmap (MAKE_IMAGE_PATH(TEXT("tuned.gif")), pBitmap, &DlgParams ) ; 
   } 
   else 
      if(nRet < 1 ) 
         return nRet; 
    
   nRet = L_DlgFree () ; 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 
Help Version 20.0.2019.9.19
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Common Dialog C API Help