PutBitmapRowCol method (Main Control)
Builder Syntax |
int __fastcall PutBitmapRowCol(void * pBuffer, int nRow, int nCol, unsigned uBytes); |
Delphi Syntax |
function PutBitmapRowCol ( pBuffer: pointer; nRow: integer; nCol: integer; uBytes: Cardinal ) : Integer ; |
Overview |
Remarks
By using this low-level method to update any part of a row, you can write a procedure that updates a single pixel or a rectangular area within the bitmap.
This method accepts an offset parameter (nCol) in pixels and a length (uBytes) in bytes. Therefore, you must consider the bits per pixel of the bitmap when specifying these parameters. The following table describes the rules:
Bits Per
Pixel |
Column Offset (in Pixels) |
Bytes to Update |
1 |
Must be a multiple of 8 (such as 0, 8, or 16). |
Should not go past the end of the row. Consider that there are 8 pixels per byte. |
4 |
Must be an even number (such as 0, 2, or 4). |
Should not go past the end of the row. Consider that there are 2 pixels per byte |
8 |
Can be any column within the bitmap |
Should not go past the end of the row. Consider that there is 1 pixel per byte. |
16 |
Can be any column within the bitmap |
Must be a multiple of 2 (such as 2, 4, or 6), because there are 2 bytes per pixel. Also, it should not go past the end of the row. |
24 |
Can be any column within the bitmap. |
Must be a multiple of 3 (such as 3, 6, or 9), because there are 3 bytes per pixel. Also, it should not go past the end of the row. |
32 |
Can be any column within the bitmap |
Must be a multiple of 4 (such as 4, 8, or 12), because there are 4 bytes per pixel. Also, it should not go past the end of the row |
The BitmapOrder Property determines color order of the target bitmap. This value can be either ORDER_RGB or ORDER_BGR.
See Also
Elements: |
GetBitmapRow method, PutBitmapRow method, GetBitmapRowCol method, BitmapBytesPerLine Property, BitmapOrder Property. |
Topics: |