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 事件的特定信息。

备注

此矩形用墨迹空间坐标指定,允许实现撤消方案。

示例

在此示例中,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