다음을 통해 공유


IVsFontAndColorUtilities.EncodeIndexedColor(COLORINDEX, UInt32) Method

Definition

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

public:
 int EncodeIndexedColor(Microsoft::VisualStudio::TextManager::Interop::COLORINDEX idx, [Runtime::InteropServices::Out] System::UInt32 % pcrResult);
int EncodeIndexedColor(Microsoft::VisualStudio::TextManager::Interop::COLORINDEX idx, [Runtime::InteropServices::Out] unsigned int & pcrResult);
public int EncodeIndexedColor (Microsoft.VisualStudio.TextManager.Interop.COLORINDEX idx, out uint pcrResult);
abstract member EncodeIndexedColor : Microsoft.VisualStudio.TextManager.Interop.COLORINDEX * uint32 -> int
Public Function EncodeIndexedColor (idx As COLORINDEX, ByRef pcrResult As UInteger) As Integer

Parameters

idx
COLORINDEX

[in] A valid member of the COLORINDEX enumeration

pcrResult
UInt32

[out] A COLORREF equivalent to the COLORINDEX supplied.

Returns

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.

Applies to