IVsFontAndColorUtilities.EncodeVSColor Method

Returns the COLORREF equivalent of a __VSSYSCOLOREX color.

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

Syntax

'宣言
Function EncodeVSColor ( _
    vsColor As Integer, _
    <OutAttribute> ByRef pcrResult As UInteger _
) As Integer
'使用
Dim instance As IVsFontAndColorUtilities
Dim vsColor As Integer
Dim pcrResult As UInteger
Dim returnValue As Integer

returnValue = instance.EncodeVSColor(vsColor, _
    pcrResult)
int EncodeVSColor(
    int vsColor,
    out uint pcrResult
)
int EncodeVSColor(
    [InAttribute] int vsColor, 
    [OutAttribute] unsigned int% pcrResult
)
function EncodeVSColor(
    vsColor : int, 
    pcrResult : uint
) : int

Parameters

  • pcrResult
    Type: System.UInt32%

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

Return Value

Type: System.Int32

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.

Permissions

See Also

Concepts

Fonts

Reference

IVsFontAndColorUtilities Interface

IVsFontAndColorUtilities Members

Microsoft.VisualStudio.Shell.Interop Namespace