How to translate legacy system (OLE) colors to (A)RGB?

Posted by Paul Sasik on Stack Overflow See other posts from Stack Overflow or by Paul Sasik
Published on 2010-04-28T19:03:19Z Indexed on 2010/04/28 19:17 UTC
Read the original article Hit count: 416

Filed under:
|
|
|
|

I have a list of color values encoded as signed integers (OLE I think) in a legacy INI file that I need to translate into (A)RGB values with .NET. An INI example:

[INI_Section]
Color=-2147483633

Doing something like:

Color.FromArgb(-2147483633)

gives an alpha-blended version of a color that is not at all what I expect. I think that a value like -2147483633 is supposed to represent a system-defined, or named color like ButtonFace. Is there a .NET method for translating these legacy colors properly? Note that pInvoke to OlePro32.dll is not an option.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about ole