共用方式為


InkOverlaySelectionResizedEventArgs.OldSelectionBoundingRect 屬性

取得選取的 Strokes 集合在 SelectionResized 事件引發之前的週框。

命名空間:  Microsoft.Ink
組件:  Microsoft.Ink (在 Microsoft.Ink.dll 中)

語法

'宣告
Public ReadOnly Property OldSelectionBoundingRect As Rectangle
'用途
Dim instance As InkOverlaySelectionResizedEventArgs
Dim value As Rectangle

value = instance.OldSelectionBoundingRect
public Rectangle OldSelectionBoundingRect { get; }
public:
property Rectangle OldSelectionBoundingRect {
    Rectangle get ();
}
/** @property */
public Rectangle get_OldSelectionBoundingRect()
public function get OldSelectionBoundingRect () : Rectangle

屬性值

型別:System.Drawing.Rectangle
選取的 Strokes 集合在 SelectionResized 事件引發之前所擁有的大小。

備註

OldSelectionBoundingRect 屬性提供 InkOverlaySelectionResizedEventArgs 事件的特定資訊。

ms582154.alert_note(zh-tw,VS.90).gif注意事項:

這個週框是以筆墨空間座標指定的,適用於復原案例。

範例

在這個範例中,SelectionResized 事件處理常式會在選取範圍調整大小之後檢查它。如果選取的 Strokes 集合已調整大小,使任一個維度小於 500 HIMETRIC 單位,則選取範圍會還原為其原始大小。

Private Sub mInkObject_SelectionResized(ByVal sender As Object, ByVal e As InkOverlaySelectionResizedEventArgs)
    Dim newBounds As Rectangle = mInkObject.Selection.GetBoundingBox()
    ' Check if we are too small
    If (newBounds.Height < 500 Or newBounds.Width < 500) Then
        ' Resize to back to original rectangle
        mInkObject.Selection.ScaleToRectangle(e.OldSelectionBoundingRect)

        ' Trick to insure that selection handles are updated
        mInkObject.Selection = mInkObject.Selection
    End If
End Sub
private void mInkObject_SelectionResized(object sender, InkOverlaySelectionResizedEventArgs e)
{
    Rectangle newBounds = mInkObject.Selection.GetBoundingBox();
    // Check if we are too small
    if (newBounds.Height < 500 || newBounds.Width < 500)
    {
        // Resize to back to original rectangle
        mInkObject.Selection.ScaleToRectangle(e.OldSelectionBoundingRect);

        // Trick to insure that selection handles are updated
        mInkObject.Selection = mInkObject.Selection;
    }
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

InkOverlaySelectionResizedEventArgs 類別

InkOverlaySelectionResizedEventArgs 成員

Microsoft.Ink 命名空間

InkOverlay

InkOverlay.SelectionResized