Compartir a través de


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

'Declaration
Function GetRGBOfItem ( _
    pInfo As AllColorableItemInfo(), _
    ByRef rguidCategory As Guid, _
    <OutAttribute> ByRef pcrForeground As UInteger, _
    <OutAttribute> ByRef pcrBackground As UInteger _
) As Integer
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
)
abstract GetRGBOfItem : 
        pInfo:AllColorableItemInfo[] * 
        rguidCategory:Guid byref * 
        pcrForeground:uint32 byref * 
        pcrBackground:uint32 byref -> int
function GetRGBOfItem(
    pInfo : AllColorableItemInfo[], 
    rguidCategory : Guid, 
    pcrForeground : uint, 
    pcrBackground : uint
) : int

Parameters

  • rguidCategory
    Type: Guid%

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

  • pcrForeground
    Type: UInt32%

    [out] A COLORREF representation of foreground color value.

  • pcrBackground
    Type: UInt32%

    [out] A COLORREF representation of background color value.

Return Value

Type: 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.

.NET Framework Security

See Also

Reference

IVsFontAndColorUtilities Interface

Microsoft.VisualStudio.Shell.Interop Namespace

Other Resources

Fonts