PaletteRGB Function | |
Get a particular color from a user-defined palette.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION PaletteRGB(
bR AS USUAL,
bG AS USUAL,
bB AS BYTE
) AS LONG
public static int PaletteRGB(
Usual bR,
Usual bG,
byte bB
)
Request Example
View SourceParameters
- bR
- Type: Usual
The amount of red in the color, as a number from 0 to 255. - bG
- Type: Usual
The amount of green in the color, as a number from 0 to 255. - bB
- Type: Byte
The amount of blue in the color, as a number from 0 to 255.
Return Value
Type:
Long
The number of the color described, relative to the numbers of the other colors in the palette.
If the color described does not have a number in the palette, the next closest number is returned.
Remarks
PaletteRGB() can be used only with devices that support palettes that can be created by Windows programmers. See the Windows API PaletteRGB() function for more information on palettes.
Examples
This example uses PaletteRGB() to create a brush with a red color. CreateSolidBrush() and SelectObject() are defined in the Win32 API library:
1hBr := CreateSolidBrush(PaletteRGB(255, 0, 0))
2SelectObject(hdc, hBr)
3
See Also