LDialogWeb::DoModalHTMLMapper

#include "ltwrappr.h"

virtual L_INT LDialogWeb::DoModalHTMLMapper(hWndOwner)

HWND hWndOwner;

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

Displays the HTML Map Creator dialog, in order to create an HTML map upon an image. Use this dialog to create an HTML map area using the given bitmap.

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

The HTML Map Creator dialog is shown in the following figure:

image\HTMLMapper.gif

This dialog also offers tuning options for the output bitmap through the dialogs displayed using LDialogWeb::DoModalJPEGWebTuner, LDialogWeb::DoModalGIFWebTuner and LDialogWeb::DoModalPNGWebTuner.

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, LDialogWeb::DoModalJPEGWebTuner, LDialogWeb::DoModalGIFWebTuner , LDialogWeb::DoModalPNGWebTuner, LBase::EnableCallBack, LDialogBase::EnablePreview, LDialogBase::EnableAutoProcess, LDialogBase::EnableToolbar, LDialogBase::Free, LDialogWeb::GetHTMLMapperParams, LDialogWeb::SetHTMLMapperParams, Class Members

Topics:

Using Imaging Common Dialog

Example 1:

void TestFunction(LBitmap * pBitmap, HWND hWnd) 
{
   L_INT nRet = 0; 
   LDialogWeb DlgWeb; 
   
   HTMLMAPPERDLGPARAMS DlgParams; 
   DlgWeb.SetBitmap (pBitmap); 
   memset ( &DlgParams, 0, sizeof (HTMLMAPPERDLGPARAMS) ) ; 
   LDialogWeb::Initialize (0); 
   DlgParams.uStructSize      = sizeof (HTMLMAPPERDLGPARAMS ) ; 

   DlgWeb.SetHTMLMapperParams(&DlgParams) ; 
   nRet = DlgWeb.DoModalHTMLMapper (hWnd); 
   // Gets the updated values for the structure
   DlgWeb.GetHTMLMapperParams (&DlgParams, sizeof(DlgParams)) ; 
   
   LDialogWeb::Free ();

}

Example 2:

void TestFunction(LBitmap * pBitmap, HWND hWnd) 
{
   L_INT nRet = 0; 
   LDialogWeb DlgWeb; 
   
   HTMLMAPPERDLGPARAMS DlgParam; 
   DLGHISTORYLIST HistoryList ; 

   // init history buffer
   HistoryList.uStructSize      = sizeof ( DLGHISTORYLIST ) ; 
   HistoryList.nEntryCount      = 5 ; 
   HistoryList.nValidEntryCount = 0 ; 
   HistoryList.nEntryLength     = 15 ; 

   AllocHistoryEntries ( &HistoryList ) ; 
   
   // init dialog params
   memset ( &DlgParam , 0, sizeof ( HTMLMAPPERDLGPARAMS ) ) ; 
   
   DlgParam.uStructSize = sizeof ( HTMLMAPPERDLGPARAMS ) ; 
   DlgParam.uDlgFlags   = 0 ; 
   DlgParam.pURLEntries = &HistoryList ; 

   
   // show the dialog   
   LDialogWeb::Initialize (0); 

   DlgWeb.SetBitmap (pBitmap); 
   DlgWeb.SetHTMLMapperParams (&DlgParam) ; 
   nRet = DlgWeb.DoModalHTMLMapper(hWnd); 

   // Gets the updated values for the structure
   DlgWeb.GetHTMLMapperParams (&DlgParam, sizeof(DlgParam)) ; 
   
   LDialogWeb::Free ();

   // clean up
   DeallocHistoryEntries ( &HistoryList ) ; 

}

L_VOID AllocHistoryEntries
 (
   LPDLGHISTORYLIST pHistoryEntries

{
   if ( NULL != pHistoryEntries ) 
   {
      pHistoryEntries->ppszEntry = (L_TCHAR**)malloc ( pHistoryEntries->nEntryCount * sizeof ( L_TCHAR* ) ) ; 

      if ( NULL != pHistoryEntries->ppszEntry ) 
      {        
         int nIndex ; 

         for ( nIndex = 0; nIndex < pHistoryEntries->nEntryCount; nIndex++ ) 
         {
            pHistoryEntries->ppszEntry [ nIndex ] = NULL ; 
         }

         for ( nIndex = 0; nIndex < pHistoryEntries->nEntryCount; nIndex++ ) 
         {
            pHistoryEntries->ppszEntry [ nIndex ] = (L_TCHAR*) malloc ( pHistoryEntries->nEntryLength * sizeof ( L_TCHAR ) ) ; 
      
            if ( NULL != pHistoryEntries->ppszEntry [ nIndex ] ) 
            {
               *pHistoryEntries->ppszEntry [ nIndex ] = 0 ; 
            }
         }
      }
   }
}

L_VOID DeallocHistoryEntries 
 (
   LPDLGHISTORYLIST pHistoryEntries 

{
   // clean up
   if ( NULL != pHistoryEntries->ppszEntry ) 
   {
      for ( int nIndex = 0; nIndex < pHistoryEntries->nEntryCount; nIndex++ ) 
      {
         if ( NULL != pHistoryEntries->ppszEntry [ nIndex ] ) 
         {
            free ( pHistoryEntries->ppszEntry [ nIndex ] ) ; 
         }
      }

      free ( pHistoryEntries->ppszEntry ) ; 
   }
}