Paints image data into a device context from a buffer.
#include "ltwrappr.h"
virtual L_INT LPaint::PaintDCBuffer(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.. If the image data in LBuff is compressed 1-bit data, you can specify the number of lines as a negative value (-nLines), as explained in Speeding Up 1-Bit Documents.
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. |
This function references a LEAD bitmap object, which may or may not have a loaded bitmap. In either case, the following fields must be specified in the LEAD bitmap object:
The Width, Height, BitsPerPixel, Order, and ViewPerspective fields must all be set to the correct values for the image. (You can use the LBitmapBase::Initialize function to set the values.)
The Palette for the bitmap object must be a valid palette (an array of RGBQUAD values). You can create or update the palette using the LBitmapBase::PutColors() function.
Except for the buffer specifications, this function uses source and destination rectangles the same as LPaint::PaintDC. For a complete explanation, refer to LPaint::PaintDC.
You can call [LPaint:PaintDCBuffer from a callback function to paint an image while a bitmap is being loaded. This technique is used through the LFile load callback functions.
The LBuff parameter is passed by reference, and is a required parameter.
Win32, x64.
L_INT LPaint__PaintDCBufferExample(LBitmapBase& LeadBitmap,HDC hDC)
{
L_INT nRet;
LPaint LeadPaint(&LeadBitmap,hDC);
L_INT i,nBytesPerLine;
L_SIZE_T zRet;
nBytesPerLine = LeadBitmap.GetBytesPerLine() ;
LBuffer LeadBuffer((DWORD)nBytesPerLine) ;
for( i = 0 ; i < LeadBitmap.GetHeight() ; i++)
{
zRet = LeadBitmap.GetRow(&LeadBuffer,i) ;
if(zRet < 1)
return FAILURE;
nRet = LeadPaint.PaintDCBuffer(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