IVsFontAndColorUtilities.GetRGBOfEncodedColor Method

Definition

Obtain the RGB value of a created tracking or indexed COLORREF representation of a color.

public:
 int GetRGBOfEncodedColor(System::UInt32 crSource, System::UInt32 crAutoColor, Guid % rguidCategory, [Runtime::InteropServices::Out] System::UInt32 % pcrResult);
public int GetRGBOfEncodedColor (uint crSource, uint crAutoColor, ref Guid rguidCategory, out uint pcrResult);
abstract member GetRGBOfEncodedColor : uint32 * uint32 * Guid * uint32 -> int
Public Function GetRGBOfEncodedColor (crSource As UInteger, crAutoColor As UInteger, ByRef rguidCategory As Guid, ByRef pcrResult As UInteger) As Integer

Parameters

crSource
UInt32

[in] A COLORREF representation of color value.

crAutoColor
UInt32

[in] A COLORREF representation of color value.

rguidCategory
Guid

[in] The GUID identifying the Category whose color values are to be obtained.

pcrResult
UInt32

[out] A COLORREF representation of color value containing the returned RGB value.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

The COLORREFcrSource used as input must be one of the following types as returned by GetColorType:

If crSource is not of type CT_AUTOMATIC, crAutoColor is ignored.

If crSource is of type CT_AUTOMATIC, the RGB value contained in crAutoColor is returned. The actual value of crSourcer is ignored.

The COLORREF returned in pcrResult has the hexadecimal format of: 0x00bbggrr

Managed code can obtain functionality equivalent to GetSysColor with SystemColors and convert between COLORREF and the System.Drawing.Color structure using M:System.Drawing.ColorTranslator.FromWin32 and M:System.Drawing.ColorTranslator.ToWin32.

Applies to