L_DlgGetEffect

#include "l_bitmap.h"

L_LTDLG_API L_INT L_DlgGetEffect(hWndOwner, pDlgParams)

L_HWND hWndOwner;

/* owner of dialog */

LPEFFECTDLGPARAMS pDlgParams;

/* pointer to a EFFECTDLGPARAMS structure */

Displays the Get Effect dialog box, and gets the options for L_EfxPaintBitmap.

Parameter

Description

hWndOwner

Handle of the window which owns the dialog.

pDlgParams

Pointer to a EFFECTDLGPARAMS 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

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 Get Effect dialog.

Required DLLs and Libraries

LTDLGEFX
LTDLGFILE
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_EfxPaintBitmap

Topics:

Dialogs: Special Effects

 

Using Imaging Common Dialog

Example

 L_INT ShowDlgGetEffectExample(HWND hWnd,pBITMAPHANDLE pBitmap)
{
   L_INT nRet;
   EFFECTDLGPARAMS DlgParams ;
   L_UINT          x ;
   HDC             hDC ;
   RECT            rcDst ;
   memset ( &DlgParams, 0, sizeof ( EFFECTDLGPARAMS ) ) ;
   DlgParams.uStructSize         = sizeof ( EFFECTDLGPARAMS ) ;
   DlgParams.pBitmap       = pBitmap ;
   DlgParams.uEffect       = EFX_EFFECT_ROLL4_T_R_T_L ;
   DlgParams.uGrain        = 5 ;
   DlgParams.uDelay        = 50 ;
   DlgParams.uMaxPass      = 1 ;
   DlgParams.bTransparent  = FALSE ;
   DlgParams.crTransparent = RGB(0,0,0) ;
   DlgParams.uWandWidth    = 3 ;
   DlgParams.crWand        = RGB(255,0,0) ;
   DlgParams.uDlgFlags     = DLG_EFFECT_SHOW_PREVIEW     |
                             DLG_EFFECT_DELAY            |
                             DLG_EFFECT_GRAIN            |
                             DLG_EFFECT_PASSES           |
                             DLG_EFFECT_TRANSPARENT      |
                             DLG_EFFECT_WAND             |
                             DLG_EFFECT_CLASS_WIPE       |
                             DLG_EFFECT_CLASS_WIPERECT   |
                             DLG_EFFECT_CLASS_WIPECIRCLE |
                             DLG_EFFECT_CLASS_PUSH       |
                             DLG_EFFECT_CLASS_SLIDE      |
                             DLG_EFFECT_CLASS_ROLL       |
                             DLG_EFFECT_CLASS_ROTATE     |
                             DLG_EFFECT_CLASS_ZOOM       |
                             DLG_EFFECT_CLASS_DRIP       |
                             DLG_EFFECT_CLASS_BLIND      |
                             DLG_EFFECT_CLASS_RANDOM     |
                             DLG_EFFECT_CLASS_CHECK      |
                             DLG_EFFECT_CLASS_BLOCKS     |
                             DLG_EFFECT_CLASS_CIRCLE     |
                             DLG_EFFECT_CLASS_ELLIPSE    ;
   nRet = L_DlgInit ( DLG_INIT_COLOR ) ;
   if(nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED)
      return nRet;
   if ( SUCCESS_DLG_OK == L_DlgGetEffect ( hWnd, &DlgParams ) )
   {
      hDC = GetDC ( hWnd ) ;
      GetClientRect ( hWnd, &rcDst ) ;
      // NOTE: you should also create and select a palette here
      for ( x = 1 ; x <= DlgParams.uMaxPass ; x++ )
      {
         nRet = L_EfxPaintBitmap(hDC,
                          DlgParams.pBitmap,
                          NULL,
                          NULL,
                          &rcDst,
                          NULL,
                          DlgParams.uEffect,
                          DlgParams.uGrain,
                          DlgParams.uDelay,
                          0,
                          0,
                          x,
                          DlgParams.uMaxPass,
                          DlgParams.bTransparent,
                          DlgParams.crTransparent,
                          DlgParams.uWandWidth,
                          DlgParams.crWand,
                          SRCCOPY ) ;
         if(nRet != SUCCESS)
            return nRet;
      }
      ReleaseDC ( hWnd, hDC ) ;
   }
   nRet = L_DlgFree();
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}