IVsFontAndColorUtilities.GetRGBOfItem Method

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)

Syntax

'宣言
Function GetRGBOfItem ( _
    pInfo As AllColorableItemInfo(), _
    ByRef rguidCategory As Guid, _
    <OutAttribute> ByRef pcrForeground As UInteger, _
    <OutAttribute> ByRef pcrBackground As UInteger _
) As Integer
'使用
Dim instance As IVsFontAndColorUtilities
Dim pInfo As AllColorableItemInfo()
Dim rguidCategory As Guid
Dim pcrForeground As UInteger
Dim pcrBackground As UInteger
Dim returnValue As Integer

returnValue = instance.GetRGBOfItem(pInfo, _
    rguidCategory, pcrForeground, pcrBackground)
int GetRGBOfItem(
    AllColorableItemInfo[] pInfo,
    ref Guid rguidCategory,
    out uint pcrForeground,
    out uint pcrBackground
)
int GetRGBOfItem(
    [InAttribute] array<AllColorableItemInfo>^ pInfo, 
    [InAttribute] Guid% rguidCategory, 
    [OutAttribute] unsigned int% pcrForeground, 
    [OutAttribute] unsigned int% pcrBackground
)
function GetRGBOfItem(
    pInfo : AllColorableItemInfo[], 
    rguidCategory : Guid, 
    pcrForeground : uint, 
    pcrBackground : uint
) : int

Parameters

  • pInfo
    Type: []

    [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.

Return Value

Type: System.Int32

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

Remarks

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.

Permissions

See Also

Concepts

Fonts

Reference

IVsFontAndColorUtilities Interface

IVsFontAndColorUtilities Members

Microsoft.VisualStudio.Shell.Interop Namespace