LPaintEffect::EffectBlt

Summary

Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into the class object's associated device context, while applying a special effect.

Syntax

#include "ltwrappr.h"

virtual L_INT LPaintEffect::EffectBlt(nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, uEffect, nSpeed, nCycles, uPass, uMaxPass, uROP=SRCCOPY)

Parameters

L_INT nXDest

X coordinate of the origin of the destination rectangle.

L_INT nYDest

Y coordinate of the origin of the destination rectangle.

L_INT nWidth

Width of the destination rectangle.

L_INT nHeight

Height of the destination rectangle.

HDC hdcSrc

Handle to the source device context.

L_INT nXSrc

X coordinate of the origin of the source rectangle.

L_INT nYSrc

Y coordinate of the origin of the source rectangle.

L_UINT uEffect

Effect to apply when painting. For valid values, refer to Effect Types.

L_INT nSpeed

Speed of the wave. Valid values are 1 to 256. This parameter is valid only if the uEffect parameter is from the Wave class.

L_INT nCycles

Number of cycles or repetitions used to draw the wave. This parameter is valid only if the uEffect parameter is from the Wave class.

L_UINT uPass

Pass number when using a pattern brush. Use 1 for painting in one pass.

L_UINT uMaxPass

Maximum passes for a pattern brush. Use 1 for painting in one pass.

L_UINT32 uROP

Windows ROP code for display. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.

Returns

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

Comments

Use this function as a replacement for the Windows BitBlt API function when you want a special painting effect.

Use LPaintEffect::SetEffectParameters to control the properties of the paint effect.

If the uEffect parameter is from the Twirl class, White Turnover class, Turnover class, Replace class, Laser class, Fade Normal class, Fade Black and White class, Fade Color class or Wave Class, the uPass and uMaxPass parameters have no effect.

The nSpeed and nCycles parameters have effect only if the uEffect parameter is from the Wave class.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LPaintEffect__EffectBltExample(LBitmapBase& LeadBitmap,HDC hDC) 
{ 
   L_INT nRet; 
   LPaintEffect LeadPaintEffect; 
   EFFECTDLGPARAMS EfxDlgParm; 
   HDC hdcSrc; 
 
   LeadPaintEffect.SetBitmap(&LeadBitmap) ; 
   LeadPaintEffect.SetDC(hDC) ; 
 
   LeadPaintEffect.GetEffectParameters(&EfxDlgParm) ; 
 
   EfxDlgParm.uDelay = 10; 
   EfxDlgParm.bTransparent = TRUE; 
   EfxDlgParm.crTransparent = RGB(10,0,255); 
 
   nRet = LeadPaintEffect.SetEffectParameters(&EfxDlgParm) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   hdcSrc = CreateCompatibleDC(hDC); 
 
   // Paint the image using EffectBlt in 3 steps 
   nRet = LeadPaintEffect.EffectBlt(0,0,LeadBitmap.GetWidth(),LeadBitmap.GetHeight(),hdcSrc,0,0, 
      EFX_EFFECT_WIPE_L_TO_R, 0, 0, 1,3); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = LeadPaintEffect.EffectBlt(0,0,LeadBitmap.GetWidth(),LeadBitmap.GetHeight(),hdcSrc,0,0, 
      EFX_EFFECT_WIPE_R_TO_L, 0, 0,2,3); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = LeadPaintEffect.EffectBlt(0,0,LeadBitmap.GetWidth(),LeadBitmap.GetHeight(),hdcSrc,0,0, 
      EFX_EFFECT_WIPE_L_TO_R, 0, 0,3,3); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   LeadPaintEffect.SetDC(0) ; 
   DeleteDC(hdcSrc); 
 
   return SUCCESS; 
} 
Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 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.