IVsHiColorItem.GetColorData Method
Retrieves the RGB value for the specified element.
Namespace: Microsoft.VisualStudio.TextManager.Interop
Assembly: Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)
Syntax
'宣言
Function GetColorData ( _
cdElement As Integer, _
<OutAttribute> ByRef pcrColor As UInteger _
) As Integer
int GetColorData(
int cdElement,
out uint pcrColor
)
int GetColorData(
[InAttribute] int cdElement,
[OutAttribute] unsigned int% pcrColor
)
abstract GetColorData :
cdElement:int *
pcrColor:uint32 byref -> int
function GetColorData(
cdElement : int,
pcrColor : uint
) : int
Parameters
- cdElement
Type: System.Int32
[in] A value from the __tagVSCOLORDATA enumeration identifying the element for which to get the color.
- pcrColor
Type: System.UInt32%
[out] The requested RGB value.
Return Value
Type: System.Int32
If successful, returns S_OK; otherwise, returns an error code.
Remarks
COM Signature
From textmgr2.idl
interface IVsHiColorItem : IUnknown
{
HRESULT GetColorData([in] VSCOLORDATA cdElement,
[out] COLORREF* pcrColor);
};
Note that the returned RGB value is a Win32 COLORREF value.
In managed code, an RGB value can be converted to a COLORREF value with the code:
uint colorRef = (uint)System.Drawing.ColorTranslator.ToWin32(
System.Drawing.Color.FromArgb(r, g, b));
In unmanaged code, use the RGB macro to create a COLORREF value, for example, RGB(0x00, 0xff,0x00).
.NET Framework Security
- 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.