다음을 통해 공유


IVsFontAndColorUtilities.GetRGBOfEncodedColor Method

Obtain the RGB value of a created tracking or indexed COLORREF representation of a color.

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

Syntax

'Declaration
Function GetRGBOfEncodedColor ( _
    crSource As UInteger, _
    crAutoColor As UInteger, _
    ByRef rguidCategory As Guid, _
    <OutAttribute> ByRef pcrResult As UInteger _
) As Integer
int GetRGBOfEncodedColor(
    uint crSource,
    uint crAutoColor,
    ref Guid rguidCategory,
    out uint pcrResult
)
int GetRGBOfEncodedColor(
    [InAttribute] unsigned int crSource, 
    [InAttribute] unsigned int crAutoColor, 
    [InAttribute] Guid% rguidCategory, 
    [OutAttribute] unsigned int% pcrResult
)
abstract GetRGBOfEncodedColor : 
        crSource:uint32 * 
        crAutoColor:uint32 * 
        rguidCategory:Guid byref * 
        pcrResult:uint32 byref -> int
function GetRGBOfEncodedColor(
    crSource : uint, 
    crAutoColor : uint, 
    rguidCategory : Guid, 
    pcrResult : uint
) : int

Parameters

  • crSource
    Type: UInt32

    [in] A COLORREF representation of color value.

  • crAutoColor
    Type: UInt32

    [in] A COLORREF representation of color value.

  • rguidCategory
    Type: Guid%

    [in] The GUID identifying the Category whose color values are to be obtained.

  • pcrResult
    Type: UInt32%

    [out] A COLORREF representation of color value containing the returned RGB value.

Return Value

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

Remarks

The COLORREFcrSource used as input must be one of the following types as returned by GetColorType:

If crSource is not of type CT_AUTOMATIC, crAutoColor is ignored.

If crSource is of type CT_AUTOMATIC, the RGB value contained in crAutoColor is returned. The actual value of crSourcer is ignored.

The COLORREF returned in pcrResult has the hexadecimal format of: 0x00bbggrr

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.

.NET Framework Security

See Also

Reference

IVsFontAndColorUtilities Interface

Microsoft.VisualStudio.Shell.Interop Namespace

Other Resources

Fonts