The LEADTOOLS RasterColor class provides a platform independent representation of an ARGB color that can be used in any platform supported by LEADTOOLS such as GDI, GDI+, and WPF.

To convert a LEADTOOLS RasterColor object to/from a device dependent color, you can either use the various properties of methods of this class (such as the A, R, G, B properties and the RasterColor(int alpha, int red, int green, int blue) constructor) directly, or use the following helper classes:

In the Document and Medical toolkits, the COLORREF value can represent a 16 bit grayscale value if RasterImage is a 12 or 16-bit grayscale bitmap. To avoid confusion with an RGB value, set the COLORREF_GRAY16 mask (0x04000000). In this case (0x0400YYYY), the lower 16 bits (0xYYYY) of the COLORREF value represent the 16-bit grayscale value. (0x0400FFFF is 16-bit white and 0x04000000 is 16-bit black.) This is not a standard Windows value. Therefore, although LEADTOOLS methods will recognize a COLORREF having this format, but Windows methods will not.