共用方式為


IVsPackageDefinedTextMarkerType.DrawGlyphWithColors 方法

繪製指定的顯示內容和色彩的週框中的圖像。

命名空間:  Microsoft.VisualStudio.TextManager.Interop
組件:  Microsoft.VisualStudio.TextManager.Interop (在 Microsoft.VisualStudio.TextManager.Interop.dll 中)

語法

'宣告
Function DrawGlyphWithColors ( _
    hdc As IntPtr, _
    pRect As RECT(), _
    iMarkerType As Integer, _
    pMarkerColors As IVsTextMarkerColorSet, _
    dwGlyphDrawFlags As UInteger, _
    iLineHeight As Integer _
) As Integer
int DrawGlyphWithColors(
    IntPtr hdc,
    RECT[] pRect,
    int iMarkerType,
    IVsTextMarkerColorSet pMarkerColors,
    uint dwGlyphDrawFlags,
    int iLineHeight
)
int DrawGlyphWithColors(
    [InAttribute] IntPtr hdc, 
    [InAttribute] array<RECT>^ pRect, 
    [InAttribute] int iMarkerType, 
    [InAttribute] IVsTextMarkerColorSet^ pMarkerColors, 
    [InAttribute] unsigned int dwGlyphDrawFlags, 
    [InAttribute] int iLineHeight
)
abstract DrawGlyphWithColors : 
        hdc:IntPtr * 
        pRect:RECT[] * 
        iMarkerType:int * 
        pMarkerColors:IVsTextMarkerColorSet * 
        dwGlyphDrawFlags:uint32 * 
        iLineHeight:int -> int
function DrawGlyphWithColors(
    hdc : IntPtr, 
    pRect : RECT[], 
    iMarkerType : int, 
    pMarkerColors : IVsTextMarkerColorSet, 
    dwGlyphDrawFlags : uint, 
    iLineHeight : int
) : int

參數

  • hdc
    類型:IntPtr

    [in]定義感興趣的可見區域的顯示裝置內容的控制代碼。

  • pRect
    類型:array<RECT[]

    [in]定義該標記的週框的矩形結構的指標。

  • iMarkerType
    類型:Int32

    [in]整數,包含標記類型。

  • dwGlyphDrawFlags
    類型:UInt32

    [in]用來繪製 widget 邊界中的圖像 (glyph) 選項。 為一系列dwGlyphDrawFlags的值,請參閱GLYPHDRAWFLAGS

  • iLineHeight
    類型:Int32

    [in]指定線條高度的整數。

傳回值

類型:Int32
如果此方法將會成功,則會傳回S_OK。如果失敗,它就會傳回錯誤碼。

備註

COM 簽章

從 textmgr.idl:

HRESULT IVsPackageDefinedTextMarkerType::DrawGlyphWithColors(
   [in] HDC hdc, [in] RECT *pRect, 
   [in] long iMarkerType, 
   [in] IVsTextMarkerColorSet *pMarkerColors, 
   [in] DWORD dwGlyphDrawFlags, 
   [in] long iLineHeight
);

如果您指定的值,呼叫這個方法由環境MV_GLYPH的標記類型。 若要使用這個方法,請在所指定的感興趣的可見區域中繪製您的圖像 (glyph) hdc的週框內的參數。 硬式編碼色彩,而不是使用pMarkerColors參數來呼叫GetMarkerColors ,並傳回從目前的標記類型或相關的資料標記的色彩,讓您同步處理使用者的色彩的自訂設定。 因為IVsTextMarkerColorSet用來判斷色彩為某些標記型別使用不同於其內嵌文字的色彩和其他標記的索引的圖像 (glyph) 色彩。

實作時,請遵循以下方針DrawGlyphWithColors:

不會將傳回的週框之外的任何項目繪製pRect參數。

使用圖形裝置介面 (GDI) 的基本項目,而不是點陣圖,因為行的大小可能會隨數量相當多的大小和縮放比例的圖形是必要的。 但是,如果您想要使用的點陣圖,提供各種不同的點陣圖大小,使您可以延伸它們適當地處理使用者可能有設定,包括非常大的大小,如 [協助工具需求的所有可用的列大小。

在您進行調整的標記不繪製任何文字。 即使萬用符號,像是驚嘆號,是令人沮喪。

如果您指定的值為MV_MULTILINE_GLYPH在您的資料標記樣式,此函式呼叫兩次,每個繪製行程 — 來繪製內部和尾端的圖像 (glyph),以及一次繪製上方進行一次。 值為dwGlyphDrawFlags傳遞至這個方法會指示該怎麼做:

如果GDF_MULTILINE是無法傳遞,則只繪製資料標記的頂端。

如果GDF_MULTILINE有指定,則您只需根據其他旗標來標記的圖像 (glyph)] 區域中填入某些計算。 如果GDF_BOTTOMEDGE,就會傳入,然後使用輸入的週框的下一行的高度部份繪製圖像的尾端。 如果GDF_TOPEDGE ,就會傳入,然後使用上方的線條高度的部分来繪製的圖像 (glyph) 的頂端。 剩餘的空間中的週框的輸入是內部,而且應該繪製由您的函式。

.NET Framework 安全性

請參閱

參考

IVsPackageDefinedTextMarkerType 介面

Microsoft.VisualStudio.TextManager.Interop 命名空間