Copies image data from the class object's bitmap to the specified buffer.
virtual L_SSIZE_T LBitmapBase::GetRow(pLBuffer, nRow)
Pointer to an LBuffer object that will receive the retrieved row. You must allocate enough space in the buffer to hold the data. To get a full row, use the value returned by LBitmapBase::GetBitsPerPixel to allocate the buffer. Or, use an empty buffer to retrieve the full row.
NOTE: The data in the buffer will be padded to Bitmap.BytesPerLine.
When getting less than full row, you must consider the bits per pixel. For a 1-bit bitmap, each byte represents 8 pixels. For a 4-bit bitmap, each byte represents 2 pixels. For an 8-bit bitmap, each byte represents 1 pixel. For a 16-bit bitmap, every 2 bytes represents one pixel. For 24-bit images, every three bytes represents one pixel. For a 32-bit bitmap, every four bytes represents one pixel. For 48-bit images, every six bytes represents one pixel. For 64-bit images, every eight bytes represents one pixel.
You can use the value returned by LBitmapBase::GetBitsPerPixel with integer math to calculate the number of bytes needed for a particular number of pixels. For example:
NumberOfBytes = (Bitmap.GetBitsPerPixel() * NumberOfPixels) / 8;
if ((Bitmap.GetBitsPerPixel() * NumberOfPixels) % 8)
++NumberOfBytes; /* Round up if necessary for a 1- or 4-bit image */
The number of the row to retrieve. The first row is 0 and the last row is 1 less than the bitmap height.
|>=1||The number of bytes retrieved.|
|< 1||An error occurred. Refer to Return Codes.|
This function copies image data from the class object's bitmap to a buffer that you specify. The data is copied exactly as it is stored in the image. The bitmap memory must be locked when you use this function. Normally, you can call LBitmapBase::Access to lock the memory before starting an operation that uses this function, then call LBitmapBase::Release when the operation is finished.
Use the LBitmapBase::GetBytesPerLine() to determine the byte count of each line. Color order is determined by the LBitmapBase::GetColorOrder() function. ORDER_GRAY is only valid for 12, 16 and 32-bit grayscale images. Locking the bitmap memory will speed up the processing. If you do not lock the bitmap memory it will be locked automatically and released automatically after getting the row data, but this will slow down the processing.
Support for 12, 16 and 32-bit grayscale images is only available in the Document/Medical Imaging editions.
/* Load the bitmap, at 24 bits per pixel */
L_CHAR * pBuff;
/* get row number 5 of the bitmap */
nRet =(L_INT)LeadBitmap.GetRow(&Buffer,5) ;
if(nRet < 1)
/*process the row data*/
for(L_INT uByte = 0; uByte < LeadBitmap.GetBytesPerLine(); uByte++)
pBuff[uByte] ^= 0xFF;
/*restore the row*/
nRet =(L_INT)LeadBitmap.PutRow(Buffer, 5);
if(nRet <1 )
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries