共用方式為


IWpfTextViewLineCollection.GetTextMarkerGeometry 方法 (SnapshotSpan, Boolean, Thickness)

取得指定的緩衝區中的文字範圍的文字標記幾何使用多邊形近似法演算法計算出的文字區域的大綱路徑。

命名空間:  Microsoft.VisualStudio.Text.Editor
組件:  Microsoft.VisualStudio.Text.UI.Wpf (在 Microsoft.VisualStudio.Text.UI.Wpf.dll 中)

語法

'宣告
Function GetTextMarkerGeometry ( _
    bufferSpan As SnapshotSpan, _
    clipToViewport As Boolean, _
    padding As Thickness _
) As Geometry
Geometry GetTextMarkerGeometry(
    SnapshotSpan bufferSpan,
    bool clipToViewport,
    Thickness padding
)
Geometry^ GetTextMarkerGeometry(
    SnapshotSpan bufferSpan, 
    bool clipToViewport, 
    Thickness padding
)
abstract GetTextMarkerGeometry : 
        bufferSpan:SnapshotSpan * 
        clipToViewport:bool * 
        padding:Thickness -> Geometry
function GetTextMarkerGeometry(
    bufferSpan : SnapshotSpan, 
    clipToViewport : boolean, 
    padding : Thickness
) : Geometry

參數

  • clipToViewport
    類型:Boolean

    如果為 true,則會裁剪所建立的幾何,以檢視區。

  • padding
    類型:Thickness

    根據不同的每一行的項目套用與邊框距離。

傳回值

類型:Geometry
A Geometry ,包含所有已格式化的文字範圍中的界限。如果範圍是空的或是並未與在 ITextView 中格式化的文字交集,則為 null。

例外狀況

例外狀況 條件
ArgumentOutOfRangeException

bufferSpan不是有效的SnapshotSpan的緩衝區。

備註

如果範圍中包含混合的傳統和雙向的文字,傳回的幾何可能包含數個不相連的區域。 這個方法會使用呈現的文字的圖像 (glyph) 的高度 (TextHeight) 來計算幾何的每一行的高度。

.NET Framework 安全性

請參閱

參考

IWpfTextViewLineCollection 介面

GetTextMarkerGeometry 多載

Microsoft.VisualStudio.Text.Editor 命名空間