IVsFontAndColorUtilities.GetRGBOfIndex Method

Obtain the RGB value corresponding to a valid member of the COLORINDEX enumeration.

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

Syntax

'Declaration
Function GetRGBOfIndex ( _
    idx As COLORINDEX, _
    <OutAttribute> ByRef pcrResult As UInteger _
) As Integer
int GetRGBOfIndex(
    COLORINDEX idx,
    out uint pcrResult
)
int GetRGBOfIndex(
    [InAttribute] COLORINDEX idx, 
    [OutAttribute] unsigned int% pcrResult
)
abstract GetRGBOfIndex : 
        idx:COLORINDEX * 
        pcrResult:uint32 byref -> int 
function GetRGBOfIndex(
    idx : COLORINDEX, 
    pcrResult : uint
) : int

Parameters

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

Remarks

The COLORREF returned in pcrResult has the hexadecimal format of: 0x00bbggrr

If an error occurs, the value of pcrResult is undefined.

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