GetPixelData method (Main Control)
Builder Syntax |
int GetPixelData (void * pData, int nRow, int nCol, int nSize); |
Delphi Syntax |
Function GetPixelData (pData: Pointer; nRow: Integer; nCol: Integer; nSize: Integer): Integer; |
Overview |
Refer to Examining and Altering Bitmaps |
Remarks
This method should be called only for 8, 16, 24, 32, 48 and 64-bit bitmaps. Here is how it works:
For 8-bit bitmaps, this method will retrieve the palette index for the specified pixel.
For 16-bit bitmaps, the method will retrieve the 2-byte value that forms the pixel.
For grayscale 16-bit bitmaps, the data will contain the gray value.
For color 16-bit bitmaps, the data contains packed 5-bit R, G and B values. The high bit contains the alpha information. The BitmapOrder Property member in determines whether the data is RGB or BGR.
For 24-bit bitmaps, the method will retrieve the 3 bytes containing the pixel color. BitmapOrder Property determines whether the data is RGB or BGR.
For 32-bit bitmaps, the method will retrieve the 4 bytes containing the pixel color and alpha information. The first 3 bytes contain the pixel color. The BitmapOrder Property determines whether the data in the first 3 bytes is RGB or BGR. The 4th byte is the alpha channel information.
For 48-bit bitmaps, the method will retrieve the 6 bytes containing the pixel color. BitmapOrder Property determines whether the data is RGB or BGR. Each color component is stored as a 16-bit value, where 0 corresponds to black and $FFFF corresponds to full white.
For 64-bit bitmaps, the method will retrieve the 8 bytes containing the pixel color and alpha information. BitmapOrder Property determines whether the data in the first 6 bytes is RGB or BGR. Each color component is stored as a 16-bit value, where 0 corresponds to black and $FFFF corresponds to full white. The last two bytes contain the alpha information (also stored as a short value).
This method will return an error if nBytes is smaller than it should be. The minimum value for nSize is indicated in a formula above.
See Also
Elements: |
|
Topics: |
|
|