LDialogEffect::DoModalGetGradient

#include "ltwrappr.h"

virtual L_INT LDialogEffect::DoModalGetGradient ( hWndOwner)

HWND hWndOwner;

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

Displays the Get Gradient dialog box, and gets the options for LPaintEffect::DrawGradient.

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_CANCEL

The "Cancel" button was pressed, and the dialog exited successfully.

< 1

An error occurred. Refer to Return Codes.

Comments

LDialogEffect::SetGradientParams must be called before using this function to set the initial values for the dialog. You can get the updated GRADIENTDLGPARAMS with the values entered by the user through the dialog by using LDialogEffect::GetGradientParams.

The Get Gradient dialog is shown in the following figure:

image\GetGradient.gif

Required DLLs and Libraries

LTDLGEFX
LTDLGFILE
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
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:

LDialogEffect::GetGradientParams, LDialogEffect::SetGradientParams, LDialogBase::Initialize, LPaintEffect::DrawGradient, LBase::EnableCallBack, LDialogBase::EnablePreview, LDialogBase::EnableAutoProcess, LDialogBase::EnableToolbar, LDialogBase::Free

Topics:

Using Imaging Common Dialog

Example

void TestFunction(LBitmap * pBitmap, HWND hWnd) 
{
   LDialogEffect DlgEffect; 
   LDialogEffect::Initialize (0); 
   DlgEffect.SetBitmap (pBitmap); 
   
   GRADIENTDLGPARAMS DlgParams; 

   memset ( &DlgParams, 0, sizeof ( GRADIENTDLGPARAMS ) ) ; 

   DlgParams.uStructSize      = sizeof ( GRADIENTDLGPARAMS ) ; 
   DlgParams.crStart   = RGB ( 0,0,255 ) ; 
   DlgParams.crEnd     = RGB ( 255,0,0 ) ; 
   DlgParams.uStyle    = EFX_GRADIENT_ANGLE_TO_RT ; 
   DlgParams.uSteps    = 200 ; 
   DlgParams.uDlgFlags = DLG_GRADIENT_SHOW_PREVIEW          |
                         DLG_GRADIENT_AUTOPREVIEW           |
                         DLG_GRADIENT_STARTCOLOR            |
                         DLG_GRADIENT_ENDCOLOR              |
                         DLG_GRADIENT_STEPS                 |
                         DLG_GRADIENT_NO_TREEVIEW           |
                         DLG_GRADIENT_CLASS_LINEAR          |
                         DLG_GRADIENT_CLASS_ANGULAR         |
                         DLG_GRADIENT_CLASS_RECTANGULAR     |
                         DLG_GRADIENT_CLASS_ELLIPTICAL      |
                         DLG_GRADIENT_CLASS_CONICAL ; 

   DlgEffect.EnableCallBack(FALSE); 
   DlgEffect.SetGradientParams (&DlgParams) ; 
   DlgEffect.DoModalGetGradient(hWnd); 
   
   // Gets the updated values for the structure
   DlgEffect.GetGradientParams (&DlgParams, sizeof(DlgParams)) ; 
   LDialogEffect::Free ();

}