Udostępnij za pośrednictwem


Metoda IVsFontAndColorUtilities.GetRGBOfItem — (AllColorableItemInfo , Guid, UInt32, UInt32)

 

Data opublikowania: październik 2016

Uzyskaj RGB (COLORREF) wartości kolor pierwszego planu i tła czcionkę i kolor kategorii z wystąpienia programu AllColorableItemInfo.

Przestrzeń nazw:   Microsoft.VisualStudio.Shell.Interop
Zestaw:  Microsoft.VisualStudio.Shell.Interop.8.0 (w Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Składnia

int GetRGBOfItem(
    AllColorableItemInfo[] pInfo,
    [InAttribute] ref Guid rguidCategory,
    out uint pcrForeground,
    out uint pcrBackground
)
int GetRGBOfItem(
    array<AllColorableItemInfo>^ pInfo,
    [InAttribute] Guid% rguidCategory,
    [OutAttribute] unsigned int% pcrForeground,
    [OutAttribute] unsigned int% pcrBackground
)
abstract GetRGBOfItem : 
        pInfo:AllColorableItemInfo[] *
        rguidCategory:Guid byref *
        pcrForeground:uint32 byref *
        pcrBackground:uint32 byref -> int
Function GetRGBOfItem (
    pInfo As AllColorableItemInfo(),
    <InAttribute> ByRef rguidCategory As Guid,
    <OutAttribute> ByRef pcrForeground As UInteger,
    <OutAttribute> ByRef pcrBackground As UInteger
) As Integer

Parametry

  • rguidCategory
    Type: System.Guid

    [in] Identyfikator GUID kategorii, w których wartości koloru są mają zostać uzyskane.

  • pcrForeground
    Type: System.UInt32

    [out] Reprezentacja COLORREF wartości koloru pierwszego planu.

  • pcrBackground
    Type: System.UInt32

    [out] COLORREF reprezentacja wartości koloru tła.

Wartość zwracana

Type: System.Int32

Jeśli metoda zakończy się pomyślnie, zwraca S_OK. Jeśli nie, zwraca kod błędu.

Uwagi

COLORREF Zwracany w pcrBackground i pcrForeground ma format szesnastkowy: 0x00bbggrr

Zarządzany kod można uzyskać funkcja GetSysColor z SystemColors i konwersji między COLORREF i System.Drawing.Color struktury przy użyciu M:System.Drawing.ColorTranslator.FromWin32 i M:System.Drawing.ColorTranslator.ToWin32.

Zobacz też

Interfejs IVsFontAndColorUtilities
Przestrzeń nazw Microsoft.VisualStudio.Shell.Interop
Używanie czcionek i kolorów

Powrót do początku