LPaintEffect::DrawGradient

Summary

Draws a rectangle into the target device context, and then fills the rectangle with a gradient.

Syntax

#include "ltwrappr.h"

virtual L_INT LPaintEffect::DrawGradient(pRect, uStyle)

Parameters

LPRECT pRect

The bounding rectangle.

L_UINT uStyle

The gradient style. For possible values, refer to Effect Gradient Styles.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Use LPaintEffect::SetGradientParameters to control the properties of the gradient.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LPaintEffect__DrawGradientExample(LBitmapBase& LeadBitmap,HDC hDC) 
{ 
   L_INT nRet; 
   LPaintEffect LeadPaintEffect ; 
   GRADIENTDLGPARAMS GradDlgParm; 
   RECT Rect ; 
 
   LeadPaintEffect.SetBitmap(&LeadBitmap) ; 
   LeadPaintEffect.SetDC(hDC) ; 
 
   LeadPaintEffect.GetGradientParameters(&GradDlgParm) ; 
 
   GradDlgParm.uSteps = 3 ; 
 
   nRet = LeadPaintEffect.SetGradientParameters(&GradDlgParm) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   Rect.left = 0 ; 
   Rect.top = 0 ; 
   Rect.right = LeadBitmap.GetWidth() ; 
   Rect.bottom = LeadBitmap.GetHeight() ; 
 
   nRet = LeadPaintEffect.DrawGradient(&Rect,EFX_GRADIENT_CONE_FROM_RB) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   LeadPaintEffect.SetDC(0); 
 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.