L_DlgGetEffect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DlgGetEffect(hWndOwner, pDlgParams)

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 dialog’s 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 can be seen below:

image\GetEffect.gif

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_VOID ShowDialog ( HWND hWnd, pBITMAPHANDLE pBitmap )
{
   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 ;
   
   L_DlgInit ( DLG_INIT_COLOR ) ;

   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++ )
      {
         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 ) ;
      }

      ReleaseDC ( hWnd, hDC ) ;
   }

   L_DlgFree ( ) ;
}