IVsFontAndColorUtilities.GetEncodedVSColor(UInt32, Int32) Method

Definition

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

public:
 int GetEncodedVSColor(System::UInt32 crSource, [Runtime::InteropServices::Out] int % pVSColor);
int GetEncodedVSColor(unsigned int crSource, [Runtime::InteropServices::Out] int & pVSColor);
public int GetEncodedVSColor (uint crSource, out int pVSColor);
abstract member GetEncodedVSColor : uint32 * int -> int
Public Function GetEncodedVSColor (crSource As UInteger, ByRef pVSColor As Integer) As Integer

Parameters

crSource
UInt32

[in] A COLORREF representation of color value.

pVSColor
Int32

[out] A valid member of the __VSSYSCOLOREX 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_VSCOLOR as returned by GetColorType.

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