LDialogWeb::DoModalJPEGWebTuner

#include "ltwrappr.h"

virtual L_INT LDialogWeb::DoModalJPEGWebTuner (hWndOwner)

HWND hWndOwner;

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

Displays the JPEG Web Tuner dialog box, and gets the tuning options used by LBitmapBase::Save.

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_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.

Comments

LDialogWeb::SetJPEGWebTunerParams must be called before using this function to set the initial values for the dialog. You can get the updated JPEGWEBTUNERDLGPARAMS with the values entered by the user through the dialog by using LDialogWeb::GetJPEGWebTunerParams.

The JPEG Web Tuner dialog is shown in the following figure:

image\JPEGWebTuner.gif

Required DLLs and Libraries

LTDLGWEB
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTFIL
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:

LDialogBase::Initialize, LDialogFile::DoModalSave, LDialogWeb::DoModalGIFWebTuner, LDialogWeb::DoModalPNGWebTuner, LBase::EnableCallBack, LDialogBase::EnablePreview, LDialogBase::EnableAutoProcess, LDialogBase::EnableToolbar, LDialogBase::Free, LDialogWeb::GetJPEGWebTunerParams, LDialogWeb::SetJPEGWebTunerParams, Class Members

Topics:

Using Imaging Common Dialog

Example 1:

void TestFunction(LBitmap * pBitmap, HWND hWnd) 
{
   L_INT nRet = 0; 
   LDialogWeb DlgWeb; 
   
   JPEGWEBTUNERDLGPARAMS DlgParams; 
   DlgWeb.SetBitmap (pBitmap); 
   memset ( &DlgParams, 0, sizeof (JPEGWEBTUNERDLGPARAMS) ) ; 
   LDialogWeb::Initialize (0); 
   DlgParams.uStructSize      = sizeof (JPEGWEBTUNERDLGPARAMS) ; 
   DlgParams.uDlgFlags  = DLG_JPEGWEBTUNER_SHOW_EXPORT |
                          DLG_JPEGWEBTUNER_SHOW_INFORMATION | 
                          DLG_JPEGWEBTUNER_SHOW_SAVETHUMBNAIL |
                          DLG_JPEGWEBTUNER_SHOW_OPTIONS |
                          DLG_JPEGWEBTUNER_SHOW_SAVETHUMBNAIL ; 

   DlgWeb.EnablePreview (TRUE); 
   DlgWeb.EnableToolbar (TRUE); 
   DlgWeb.EnableCallBack(FALSE); 
   DlgWeb.SetJPEGWebTunerParams(&DlgParams) ; 
   nRet = DlgWeb.DoModalJPEGWebTuner(hWnd); 
   // Gets the updated values for the structure
   DlgWeb.GetJPEGWebTunerParams (&DlgParams, sizeof(DlgParams)) ; 
   
   LDialogWeb::Free ();
}

Example 2:

void TestFunction(LBitmap * pBitmap, HWND hWnd) 
{
   L_INT nRet = 0; 
   LDialogWeb DlgWeb; 
   
   JPEGWEBTUNERDLGPARAMS DlgParams; 
   DlgWeb.SetBitmap (pBitmap); 
   memset ( &DlgParams, 0, sizeof (JPEGWEBTUNERDLGPARAMS) ) ; 
   LDialogWeb::Initialize (0); 
   DlgParams.uStructSize      = sizeof (JPEGWEBTUNERDLGPARAMS) ; 
   DlgParams.uDlgFlags  = DLG_JPEGWEBTUNER_SHOW_INFORMATION | 
                          DLG_JPEGWEBTUNER_SHOW_SAVETHUMBNAIL |
                          DLG_JPEGWEBTUNER_SHOW_OPTIONS ; 

   DlgWeb.SetJPEGWebTunerParams (&DlgParams) ; 
   nRet = DlgWeb.DoModalJPEGWebTuner(hWnd); 
   // Gets the updated values for the structure
   DlgWeb.GetJPEGWebTunerParams (&DlgParams, sizeof(DlgParams)) ; 
   
   LDialogWeb::Free ();

   if ( SUCCESS_DLG_OK == nRet ) 
   {
      ExportBitmap ( TEXT("tuned.jpg"), pBitmap, &DlgParams ) ; 
   }

}


L_VOID ExportBitmap 
 (
   L_TCHAR L_FAR * szFileName, 
   LBitmapBase *pLBitmap, 
   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 ; 
      }

      pLBitmap->Save( szFileName, 
                     pParam->nFormat, 
                     24, 
                     pParam->nQuality, 
                     0, 
                     &SaveOption ) ; 

   }// SAVE TO DISK
}