Condividi tramite


Proprietà InkOverlaySelectionMovingEventArgs.NewPixelRect

Aggiornamento: novembre 2007

Ottiene il rettangolo nel quale la selezione viene spostata dopo l'evento SelectionMoving.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Sintassi

'Dichiarazione
Public ReadOnly Property NewPixelRect As Rectangle
'Utilizzo
Dim instance As InkOverlaySelectionMovingEventArgs
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

Valore proprietà

Tipo: System.Drawing.Rectangle
Rettangolo nel quale la selezione viene spostata dopo l'evento SelectionMoving.

Esempi

In questo esempio un gestore dell'evento SelectionMoving esamina una selezione prima che venga spostata. Se la selezione viene spostata in modo tale che una parte di essa si trova all'esterno dei limiti della finestra, il gestore eventi visualizza in rosso la selezione modificando la proprietà Color di ogni oggetto Stroke selezionato.

Private Sub mInkObject_SelectionMoving(ByVal sender As Object, ByVal e As InkOverlaySelectionMovingEventArgs)
    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_SelectionMoving(object sender, InkOverlaySelectionMovingEventArgs 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;
        }
    }
}

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

InkOverlaySelectionMovingEventArgs Classe

Membri InkOverlaySelectionMovingEventArgs

Spazio dei nomi Microsoft.Ink

InkOverlay

InkOverlay.SelectionMoving