IVsFontAndColorUtilities::GetRGBOfEncodedColor Method (UInt32, UInt32, Guid, UInt32)

 

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

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

int GetRGBOfEncodedColor(
	unsigned int crSource,
	unsigned int crAutoColor,
	[InAttribute] Guid% rguidCategory,
	[OutAttribute] unsigned int% pcrResult
)

Parameters

crSource
Type: System::UInt32

[in] A COLORREF representation of color value.

crAutoColor
Type: System::UInt32

[in] A COLORREF representation of color value.

rguidCategory
Type: System::Guid

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

pcrResult
Type: System::UInt32

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

Return Value

Type: System::Int32

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

The COLORREF crSource 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.

Return to top
Show: