Retrieves a row (or part of a row) of 1-bit compressed data from a class objects bitmap.
virtual L_SSIZE_T LBitmapBase::GetRowColCompressed(pLRunBuffer, nRow, nCol, uWidth, pWorkBuffer=NULL)
Pointer to an LBuffer object that will receive the retrieved data. Calculate the required size of this buffer as follows: bytes required = (nWidth + 3) * 2.
The number of the row to retrieve. The first row is 0 and the last row is 1 less than the bitmap height.
The number of column from which to get the data. The first column offset is 0, and the last column offset is 1 less than the bitmap width.
The number of pixels to retrieve.
A pointer to an optional work buffer. You can also pass NULL. Allocating the work buffer speeds processing if you call this function more than once, because if you do not allocate a work buffer, the function allocates and frees a temporary buffer each time it is called. The size of this buffer should be the same as the value returned by LBitmapBase::GetBytesPerLine
|> 0||The number of pixels processed.|
|< 1||An error occurred. Refer to Return Codes.|
Retrieves a row (or part of a row) of 1-bit compressed data from a class objects bitmap that has been loaded in its compressed format.
This function is useful for working with 1-bit images that are loaded in their compressed formats for faster loading and display. For more information, refer to Speeding Up 1-Bit Documents.
This example demonstrates the low-level functions for accessing
1-bit compressed bitmap data. It demonstrates the ability to get and put
partial rows, and the ability to process partial rows in buffer-to-buffer
L_INT LBitmapBase__GetRowColCompressedExample(L_TCHAR * pszFilename, HWND hWnd,
LBitmapBase LeadBitmap/* Bitmap handle for the image */)
L_INT XOffset; /* Column offset of the rectangle to process */
L_INT XSize; /* Pixel width of the rectangle to process */
L_INT YOffset; /* Row offset of the rectangle to process */
L_INT YSize; /* Pixel height of the rectangle to process */
LBuffer RunBuffer; /* Handle to the pRunBuffer */
LBuffer WorkBuffer; /* Handle to the pWorkBuffer */
L_INT i; /* Counters */
/* Load the bitmap, at 1 bit per pixel */
nRet =LeadBitmap.File()->LoadFile(1,0,LOADFILE_COMPRESSED | LOADFILE_ALLOCATE | LOADFILE_STORE);
/* This example does not work with rotated view perspectives */
if ( (LeadBitmap.GetViewPerspective() != TOP_LEFT) || (LeadBitmap.GetViewPerspective() != BOTTOM_LEFT) )
nRet =LeadBitmap.ChangeViewPerspective ( TOP_LEFT );
/* Specify a rectangle in the middle right part of the displayed image */
XOffset = LeadBitmap.GetWidth() / 3;
XSize = LeadBitmap.GetWidth() * 2 / 3;
YOffset = LeadBitmap.GetHeight() / 3;
YSize = LeadBitmap.GetHeight() / 3;
/* Adjust the YOffset if the view perspective is bottom left */
if (LeadBitmap.GetViewPerspective() == BOTTOM_LEFT)
YOffset = LeadBitmap.GetHeight() - YOffset - YSize;
/* Allocate the buffers */
nRet =RunBuffer.Reallocate( (XSize + 3) * 2);
for(i=YOffset; i < (YOffset + YSize); i++)
nRet =(L_INT)LeadBitmap.GetRowColCompressed(&RunBuffer, i, XOffset, XSize, &WorkBuffer);
nRet =(L_INT)LeadBitmap.PutRowColCompressed(RunBuffer, i, XOffset, XSize/ 2,&WorkBuffer);
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries