IVsFontAndColorUtilities.GetRGBOfItem Method
Obtain the RGB (COLORREF) values of the foreground and background color of a Font and Color Category from an instance of AllColorableItemInfo.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
Syntax
'宣言
Function GetRGBOfItem ( _
pInfo As AllColorableItemInfo(), _
ByRef rguidCategory As Guid, _
<OutAttribute> ByRef pcrForeground As UInteger, _
<OutAttribute> ByRef pcrBackground As UInteger _
) As Integer
'使用
Dim instance As IVsFontAndColorUtilities
Dim pInfo As AllColorableItemInfo()
Dim rguidCategory As Guid
Dim pcrForeground As UInteger
Dim pcrBackground As UInteger
Dim returnValue As Integer
returnValue = instance.GetRGBOfItem(pInfo, _
rguidCategory, pcrForeground, pcrBackground)
int GetRGBOfItem(
AllColorableItemInfo[] pInfo,
ref Guid rguidCategory,
out uint pcrForeground,
out uint pcrBackground
)
int GetRGBOfItem(
[InAttribute] array<AllColorableItemInfo>^ pInfo,
[InAttribute] Guid% rguidCategory,
[OutAttribute] unsigned int% pcrForeground,
[OutAttribute] unsigned int% pcrBackground
)
function GetRGBOfItem(
pInfo : AllColorableItemInfo[],
rguidCategory : Guid,
pcrForeground : uint,
pcrBackground : uint
) : int
Parameters
pInfo
Type: [][in] An instance of AllColorableItemInfo. containing the Font and Color information for a given Category.
rguidCategory
Type: System.Guid%[in] The GUID identifying the Category whose color values are to be obtained.
pcrForeground
Type: System.UInt32%[out] A COLORREF representation of foreground color value.
pcrBackground
Type: System.UInt32%[out] A COLORREF representation of background color value.
Return Value
Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
The COLORREF returned in pcrBackground and in pcrForeground 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