InkOverlaySelectionResizingEventArgs.NewPixelRect - свойство
Обновлен: Ноябрь 2007
Gets the bounding rectangle of the selection after the SelectionResizing event, as a Rectangle structure.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public ReadOnly Property NewPixelRect As Rectangle
'Применение
Dim instance As InkOverlaySelectionResizingEventArgs
Dim value As Rectangle
value = instance.NewPixelRect
public Rectangle NewPixelRect { get; }
public:
property Rectangle NewPixelRect {
Rectangle get ();
}
/** @property */
public Rectangle get_NewPixelRect()
public function get NewPixelRect () : Rectangle
Значение свойства
Тип: System.Drawing.Rectangle
The size of the selection after the SelectionResizing event.
Заметки
The NewPixelRect property provides specific information about the InkOverlaySelectionResizingEventArgs event.
Примечание. |
---|
This Rectangle structure is specified in client window coordinates, which allows for scenarios such as maintaining the aspect ratio when resizing. |
Примеры
In this example, an SelectionResizing event handler examines a selection before it has been resized. If the selection will be resized so that any of it is outside the bounds of the window, the event handler turns the selection red by changing the Color property of each selected Stroke object.
Private Sub mInkObject_SelectionResizing(ByVal sender As Object, ByVal e As InkOverlaySelectionResizingEventArgs)
If e.NewPixelRect.Left < 0 Or e.NewPixelRect.Top < 0 Or _
e.NewPixelRect.Right > mInkObject.AttachedControl.ClientRectangle.Width Or _
e.NewPixelRect.Bottom > mInkObject.AttachedControl.ClientRectangle.Height Then
For Each stroke As Stroke In mInkObject.Selection
' change the stroke color
stroke.DrawingAttributes.Color = Color.Red
Next
End If
End Sub
private void mInkObject_SelectionResizing(object sender, InkOverlaySelectionResizingEventArgs e)
{
if (e.NewPixelRect.Left < 0 || e.NewPixelRect.Top < 0 ||
e.NewPixelRect.Right > mInkObject.AttachedControl.ClientRectangle.Width ||
e.NewPixelRect.Bottom > mInkObject.AttachedControl.ClientRectangle.Height)
{
foreach (Stroke stroke in mInkObject.Selection)
{
// change the stroke color
stroke.DrawingAttributes.Color = Color.Red;
}
}
}
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0
См. также
Ссылки
InkOverlaySelectionResizingEventArgs Класс
InkOverlaySelectionResizingEventArgs - члены