次の方法で共有


IVsFontAndColorUtilities.EncodeVSColor(Int32, UInt32) Method

Definition

Returns the COLORREF equivalent of a __VSSYSCOLOREX color.

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

Parameters

vsColor
Int32

[in] A valid member of the __VSSYSCOLOREX enumeration.

pcrResult
UInt32

[out] A COLORREF representation of the color of the system component specified by the vsColor parameter.

Returns

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

Remarks

The RGB value returned in pcrResult has the following hexadecimal format 0x00bbggrr.

The value of pcrResult returns the current color value of the component indicated by the __VSSYSCOLOREX enumeration passed by the argument vsColor.

The COLORREF will have a type of CT_VSCOLOR 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