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

.NET Framework Security

See Also

Reference

IVsFontAndColorUtilities Interface

IVsFontAndColorUtilities Members

Microsoft.VisualStudio.Shell.Interop Namespace

Other Resources

Fonts