IVsFontAndColorUtilities.GetEncodedIndex Method

Obtain a valid member of the COLORINDEX enumeration corresponding to a supplied COLORREF.

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

Syntax

'宣言
Function GetEncodedIndex ( _
    crSource As UInteger, _
    <OutAttribute> pIdx As COLORINDEX() _
) As Integer
'使用
Dim instance As IVsFontAndColorUtilities
Dim crSource As UInteger
Dim pIdx As COLORINDEX()
Dim returnValue As Integer

returnValue = instance.GetEncodedIndex(crSource, _
    pIdx)
int GetEncodedIndex(
    uint crSource,
    COLORINDEX[] pIdx
)
int GetEncodedIndex(
    [InAttribute] unsigned int crSource, 
    [OutAttribute] array<COLORINDEX>^ pIdx
)
function GetEncodedIndex(
    crSource : uint, 
    pIdx : COLORINDEX[]
) : int

Parameters

  • pIdx
    Type: []

    [out] A valid member of the COLORINDEX enumeration corresponding crSource.

Return Value

Type: System.Int32

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

Remarks

The COLORREFcrSource used as input must a type of CT_COLORINDEX as returned by GetColorType.

If an error occurs, the value of pIdx 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.

Permissions

See Also

Concepts

Fonts

Reference

IVsFontAndColorUtilities Interface

IVsFontAndColorUtilities Members

Microsoft.VisualStudio.Shell.Interop Namespace