Condividi tramite


Proprietà InkOverlay.AutoRedraw

Aggiornamento: novembre 2007

Ottiene o imposta un valore che specifica se l'oggetto InkOverlay ridisegna l'input penna quando la finestra viene invalidata.

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

Sintassi

'Dichiarazione
<BrowsableAttribute(True)> _
Public Property AutoRedraw As Boolean
'Utilizzo
Dim instance As InkOverlay
Dim value As Boolean

value = instance.AutoRedraw

instance.AutoRedraw = value
[BrowsableAttribute(true)]
public bool AutoRedraw { get; set; }
[BrowsableAttribute(true)]
public:
property bool AutoRedraw {
    bool get ();
    void set (bool value);
}
/** @property */
/** @attribute BrowsableAttribute(true) */
public boolean get_AutoRedraw()
/** @property */
/** @attribute BrowsableAttribute(true) */
public  void set_AutoRedraw(boolean value)
public function get AutoRedraw () : boolean
public function set AutoRedraw (value : boolean)

Valore proprietà

Tipo: System.Boolean
Valore che specifica se l'oggetto InkOverlay ridisegna l'input penna quando la finestra viene invalidata.
true se l'oggetto InkOverlay ridisegna l'input penna quando la finestra viene invalidata; in caso contrario, false.

Note

Il valore dell'oggetto AutoRedraw specifica se l'oggetto Ink associato attualmente all'oggetto InkOverlay verrà ridisegnato automaticamente quando la finestra associata all'oggetto InkOverlay riceve una notifica Paint. Ad esempio, se è impostato su true, quando si riduce e quindi si ripristina la finestra, l'input penna viene ridisegnato automaticamente. Se è impostato su false, quando si riduce e quindi si ripristina la finestra, l'input penna viene rimosso dalla visualizzazione.

Quando l'oggetto AutoRedraw è false, l'input penna viene visualizzato durante l'immissione a meno che la proprietà DynamicRendering non sia impostata su false.

Se l'applicazione esegue il rendering personalizzato oppure è condizionata dai problemi di disegno, è possibile gestire personalmente il nuovo disegno e impostare la proprietà AutoRedraw su false per l'oggetto InkOverlay. In tal caso, aggiungere un delegato al gestore eventi OnPainted dell'oggetto InkOverlay per disegnare l'input penna o gestire il sottostante evento Invalidate del controllo per modificare l'oggetto InvalidateEventArgs.

Esempi

In questo esempio vengono visualizzati i tratti di un oggetto InkOverlay impostando la proprietà AutoRedraw su false e disegnando quindi manualmente l'input penna. Il gestore eventi Paint del controllo a cui è associato l'oggetto InkCollector verifica la dimensione di ogni tratto. Se il tratto è inferiore alle 400 unità dello spazio di input penna, viene visualizzato in blu.

Private Sub mInkObjectControl_Paint(ByVal sender As Object, ByVal e As PaintEventArgs)

    ' Check if AutoRedraw is off
    ' mInkObject can be InkCollector, InkOverlay, or InkPicture
    If Not mInkObject.AutoRedraw Then

        ' Draw each stroke manually
        For Each stroke As Stroke In mInkObject.Ink.Strokes
            ' See if this stroke is small
            Dim strokeBounds As Rectangle = stroke.GetBoundingBox()
            If strokeBounds.Width < 400 And strokeBounds.Height < 400 Then
                ' Change the drawing color to blue
                Dim newAttributes As DrawingAttributes = stroke.DrawingAttributes.Clone()
                newAttributes.Color = Color.Blue
                ' Draw with these special drawing attributes
                mInkObject.Renderer.Draw(e.Graphics, stroke, newAttributes)
            Else
                ' Draw stroke with its own drawing attributes
                mInkObject.Renderer.Draw(e.Graphics, stroke)
            End If
        Next
    End If

End Sub
private void mInkObjectControl_Paint(object sender, PaintEventArgs e)
{
    // Check if AutoRedraw is off
    // mInkObject can be InkCollector, InkOverlay, or InkPicture
    if (!mInkObject.AutoRedraw)
    {
        // Draw each stroke manually
        foreach (Stroke stroke in mInkObject.Ink.Strokes)
        {
            // See if this stroke is small
            Rectangle strokeBounds = stroke.GetBoundingBox();
            if (strokeBounds.Width < 400 && strokeBounds.Height < 400)
            {
                // Change the drawing color to blue
                DrawingAttributes newAttributes = stroke.DrawingAttributes.Clone();
                newAttributes.Color = Color.Blue;

                // Draw with these special drawing attributes
                mInkObject.Renderer.Draw(e.Graphics, stroke, newAttributes);
            }
            else
            {
                // Draw stroke with its own drawing attributes
                mInkObject.Renderer.Draw(e.Graphics, stroke);
            }
        }
    }

}

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

InkOverlay Classe

Membri InkOverlay

Spazio dei nomi Microsoft.Ink

InkOverlay.DynamicRendering

InkOverlay.OnPainted