L_DlgGetEffect

#include "l_bitmap.h"

L_LTDLG_API L_INT L_DlgGetEffect(hWndOwner, pDlgParams)

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

Parameters

L_HWND hWndOwner

Handle of the window which owns the dialog.

LPEFFECTDLGPARAMS 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

Value Meaning
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

See Also

Functions

Topics

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; 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Common Dialog C API Help