IVsFontAndColorUtilities.GetEncodedIndex(UInt32, COLORINDEX[]) Method

Definition

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

public:
 int GetEncodedIndex(System::UInt32 crSource, cli::array <Microsoft::VisualStudio::TextManager::Interop::COLORINDEX> ^ pIdx);
public:
 int GetEncodedIndex(unsigned int crSource, Platform::Array <Microsoft::VisualStudio::TextManager::Interop::COLORINDEX> ^ pIdx);
int GetEncodedIndex(unsigned int crSource, std::Array <Microsoft::VisualStudio::TextManager::Interop::COLORINDEX> const & pIdx);
public int GetEncodedIndex (uint crSource, Microsoft.VisualStudio.TextManager.Interop.COLORINDEX[] pIdx);
abstract member GetEncodedIndex : uint32 * Microsoft.VisualStudio.TextManager.Interop.COLORINDEX[] -> int
Public Function GetEncodedIndex (crSource As UInteger, pIdx As COLORINDEX()) As Integer

Parameters

crSource
UInt32

[in] A COLORREF representation of color value.

pIdx
COLORINDEX[]

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

Returns

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.

Applies to