| Herd Software Development
|=
DaVinci Graphics Library
|==
DaVinci Documentation Home Search Order


Leonardo: The RWGetPixel function

This function retrieves the RGB value of the pixel at the specified x-y coordinate.

COLORREF API RWGetPixel(
HDIBRW hDibRW,
int x,
int y);

hDibRW HDIBRW Handle for DIB access returned by RWOpenDIB

x int Horizontal coordinate of the pixel to be retrieved; i.e. the number of the pixels from the left edge of the DIB to the desired pixel.

y int Vertical coordinate of the pixel to be retrieved; i.e. the number of the pixels from the bottom edge to the desired pixel. (0 in this function points to the bottom row of pixels, rather than the top row.)

Return value

The function returns an RGB value for the color of the specified point. Returns -1 if the coordinates are outside of the DIB.

Remarks

The function is designed to be used almost exactly the same way as the Windows API function GetPixel with the exception that GetPixel uses standard y coordinate convention (vertical rows counted downward from 0), while RWGetPixel determines y coordinates by counting upward from 0, with 0 representing the lower edge of the DIB.