IVsFontAndColorUtilities::GetRGBOfItem Method (array<AllColorableItemInfo>^, Guid, UInt32, UInt32)

 

Obtain the RGB (COLORREF) values of the foreground and background color of a Font and Color Category from an instance of AllColorableItemInfo.

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

int GetRGBOfItem(
	array<AllColorableItemInfo>^ pInfo,
	[InAttribute] Guid% rguidCategory,
	[OutAttribute] unsigned int% pcrForeground,
	[OutAttribute] unsigned int% pcrBackground
)

Parameters

pInfo
Type: array<Microsoft.VisualStudio.Shell.Interop::AllColorableItemInfo>^

[in] An instance of AllColorableItemInfo. containing the Font and Color information for a given Category.

rguidCategory
Type: System::Guid

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

pcrForeground
Type: System::UInt32

[out] A COLORREF representation of foreground color value.

pcrBackground
Type: System::UInt32

[out] A COLORREF representation of background color value.

Return Value

Type: System::Int32

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

The COLORREF returned in pcrBackground and in pcrForeground 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: