|
Get the color of a specific pixel
The function can only be called after at least one render was done.
The function support the following bitmap formats
D3DFMT_A8R8G8B8, D3DFMT_X8R8G8B8, D3DFMT_A4R4G4B4, D3DFMT_A1R5G5B5
Note that the engine default bitmap format is BITMAP_FORMAT_DXT1 (which is a compressed format)
This means that if you plan to use the STATE_bitmap_get_pixel() or STATE_bitmap_set_pixel()
You need to call STATE_bitmap_set_default_format(BITMAP_FORMAT_A8R8G8B8); (for example)
at the beginning of the program (or at least before the first render ).
Parameters:
bitmap_handle [IN]:
The bitmap handle.
x,y [IN]:
the specific pixel. 0,0 it the top left corner of the bitmap
(width-1, height-1) is mapped is the bottom right corner.
To get the width and height of the bitmap use STATE_bitmap_get_height()
and STATE_bitmap_get_width()
RGBA [OUT]:
returns the color and alpha value of the pixel.
RGBA[0] is red
RGBA[1] is green
RGBA[2] is blue
RGBA[3] is the alpha value
Note that even if the bitmap is is in 16 bit format the pixel format will be conveted to the RGBA format
Return Value:
Return OK or VR_ERROR. VR_ERROR is returned if the function is called before the first render or when x,y are out of range.
See also STATE_bitmap_get_height(), STATE_bitmap_get_width()
STATE_bitmap_set_pixel()
|