IVsFontAndColorUtilities.EncodeIndexedColor Method

Translates a member of the COLORINDEX enumeration into its RGB (COLORREF) color value equivalent.

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

Syntax

'宣言
Function EncodeIndexedColor ( _
    idx As COLORINDEX, _
    <OutAttribute> ByRef pcrResult As UInteger _
) As Integer
'使用
Dim instance As IVsFontAndColorUtilities
Dim idx As COLORINDEX
Dim pcrResult As UInteger
Dim returnValue As Integer

returnValue = instance.EncodeIndexedColor(idx, _
    pcrResult)
int EncodeIndexedColor(
    COLORINDEX idx,
    out uint pcrResult
)
int EncodeIndexedColor(
    [InAttribute] COLORINDEX idx, 
    [OutAttribute] unsigned int% pcrResult
)
function EncodeIndexedColor(
    idx : COLORINDEX, 
    pcrResult : uint
) : int

Parameters

Return Value

Type: System.Int32

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

Remarks

The value returned in pcrResult is a COLORREF representation of the current color value of the component indicated by the COLORINDEX enumeration used as the argument idx.

The COLORREF value will have a type of CT_COLORINDEX as returned by GetColorType.

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