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
'宣言
Function GetRGBOfEncodedColor ( _
crSource As UInteger, _
crAutoColor As UInteger, _
ByRef rguidCategory As Guid, _
<OutAttribute> ByRef pcrResult As UInteger _
) As Integer
'使用
Dim instance As IVsFontAndColorUtilities
Dim crSource As UInteger
Dim crAutoColor As UInteger
Dim rguidCategory As Guid
Dim pcrResult As UInteger
Dim returnValue As Integer
returnValue = instance.GetRGBOfEncodedColor(crSource, _
crAutoColor, rguidCategory, pcrResult)
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
)
function GetRGBOfEncodedColor(
crSource : uint,
crAutoColor : uint,
rguidCategory : Guid,
pcrResult : uint
) : int
Parameters
crSource
Type: System.UInt32[in] A COLORREF representation of color value.
crAutoColor
Type: System.UInt32[in] A COLORREF representation of color value.
rguidCategory
Type: System.Guid%[in] The GUID identifying the Category whose color values are to be obtained.
pcrResult
Type: System.UInt32%[out] A COLORREF representation of color value containing the returned RGB value.
Return Value
Type: System.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.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Concepts
Reference
IVsFontAndColorUtilities Interface