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.
#include "ltwrappr.h"
virtual L_INT LPaint::PaintRgnDCBuffer(LBuff, nRow, nCount=1, uROP3=SRCCOPY)
A LEAD buffer of type LBuffer that contains the image data to paint.
The first row to paint. The painted portion of any row may be limited by the bitmap object rectangles.
The number of rows to paint. The painted portion of any row may be limited by the bitmap object rectangles.
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.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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.
Win32, x64.
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 Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document