Поделиться через


IVsHiColorItem.GetColorData - метод

Возвращает RGB-значение для указанного элемента.

Пространство имен:  Microsoft.VisualStudio.TextManager.Interop
Сборка:  Microsoft.VisualStudio.TextManager.Interop.8.0 (в Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

Синтаксис

'Декларация
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

Параметры

  • cdElement
    Тип: Int32

    [in] значение из __tagVSCOLORDATA перечисление, указывающее элемент, для которого возвращается ключ.

  • pcrColor
    Тип: UInt32%

    [out] значения rgb.

Возвращаемое значение

Тип: Int32
В случае успеха возвращает S_OK; в противном случае возвращает код ошибки.

Заметки

Модель COM подписи

Из textmgr2.idl

interface IVsHiColorItem : IUnknown
    {
        HRESULT GetColorData([in] VSCOLORDATA cdElement,
                             [out] COLORREF* pcrColor);
    };

Видит, что возвращаемое rgb Win32 COLORREF значения.

В управляемом коде rgb может быть преобразовано к a COLORREF значение код:

    uint colorRef = (uint)System.Drawing.ColorTranslator.ToWin32(
                              System.Drawing.Color.FromArgb(r, g, b));

в неуправляемом коде, используйте RGB макрос для создания a COLORREF значение, например RGB(0x00, 0xff,0x00).

Безопасность платформы .NET Framework

См. также

Ссылки

IVsHiColorItem Интерфейс

Microsoft.VisualStudio.TextManager.Interop - пространство имен