LPaint::PaintRgnDCBuffer

Summary

Paints image data into a device context from a buffer. This function works the same as LPaint::PaintDCBuffer, except that only the bitmap region is painted.

Syntax

#include "ltwrappr.h"

virtual L_INT LPaint::PaintRgnDCBuffer(LBuff, nRow, nCount=1, uROP3=SRCCOPY)

Parameters

LBuffer& LBuff

A LEAD buffer of type LBuffer that contains the image data to paint.

L_INT nRow

The first row to paint. The painted portion of any row may be limited by the bitmap object rectangles.

L_INT nCount

The number of rows to paint. The painted portion of any row may be limited by the bitmap object rectangles.

L_UINT32 uROP3

The Windows ROP code that determines how the destination rectangle is updated. 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

The bitmap must be allocated before you can create a region for it. Therefore, if you use this function in a paint-while-load routine, you must use your callback function to create the region after the bitmap is allocated.

The LBuff parameter is passed by reference, and is a required parameter.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LPaint__PaintRgnDCBufferExample(LBitmapBase& LeadBitmap,HDC hDC) 
{ 
   L_INT nRet; 
   LPaint LeadPaint(&LeadBitmap,hDC); 
   LBitmapRgn LeadRegion; 
   L_INT i,nBytesPerLine ; 
   RECT Rect ; 
 
   Rect.left = 10 ; 
   Rect.top = 10 ; 
   Rect.right = 50 ; 
   Rect.bottom = 50 ; 
 
   LeadRegion.SetBitmap(&LeadBitmap) ; 
   nRet = LeadRegion.SetRgnRect(&Rect); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nBytesPerLine = LeadBitmap.GetBytesPerLine() ; 
   LBuffer  LeadBuffer((DWORD)nBytesPerLine); 
 
   for (i=0;i<LeadBitmap.GetHeight();i++) 
   { 
      LeadBitmap.GetRow(&LeadBuffer,i) ; 
      nRet = LeadPaint.PaintRgnDCBuffer(LeadBuffer,i) ; 
      if(nRet != SUCCESS) 
         return nRet; 
   } 
 
   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.