DynamicRenderer.Reset(StylusDevice, StylusPointCollection) DynamicRenderer.Reset(StylusDevice, StylusPointCollection) DynamicRenderer.Reset(StylusDevice, StylusPointCollection) Method

Définition

Efface le rendu sur le trait actuel et le redessine.Clears rendering on the current stroke and redraws it.

public:
 virtual void Reset(System::Windows::Input::StylusDevice ^ stylusDevice, System::Windows::Input::StylusPointCollection ^ stylusPoints);
public virtual void Reset (System.Windows.Input.StylusDevice stylusDevice, System.Windows.Input.StylusPointCollection stylusPoints);
abstract member Reset : System.Windows.Input.StylusDevice * System.Windows.Input.StylusPointCollection -> unit
override this.Reset : System.Windows.Input.StylusDevice * System.Windows.Input.StylusPointCollection -> unit

Paramètres

stylusDevice
StylusDevice StylusDevice StylusDevice

Le périphérique de stylet actuel.The current stylus device.

stylusPoints
StylusPointCollection StylusPointCollection StylusPointCollection

Les points du stylet à redessiner.The stylus points to be redrawn.

Exceptions

Ni le stylet, ni la souris n'est enfoncé.Neither the stylus nor the mouse is in the down state.

Exemples

L’exemple suivant modifie la couleur du trait actuel au fur et à mesure qu’il est dessiné.The following example changes the color of the current stroke as it is being drawn.

bool selectionMode = false;

public void ToggleSelect()
{
    StylusDevice currentStylus = Stylus.CurrentStylusDevice;

    // Check if the stylus is down or the mouse is pressed.
    if (Mouse.LeftButton != MouseButtonState.Pressed &&
        (currentStylus == null || currentStylus.InAir))
    {
        return;
    }
    
    selectionMode = !selectionMode;

    // If the control is in selection mode, change the color of 
    // the current stroke dark gray.
    if (selectionMode)
    {
        dynamicRenderer1.DrawingAttributes.Color = Colors.DarkGray;
       
    }
    else
    {
        dynamicRenderer1.DrawingAttributes.Color = Colors.Purple;
        
    }

    dynamicRenderer1.Reset(currentStylus, stylusPoints);
}
Private selectionMode As Boolean = False


Public Sub ToggleSelect() 
    Dim currentStylus As StylusDevice = Stylus.CurrentStylusDevice
    
    ' Check if the stylus is down or the mouse is pressed.
    If Mouse.LeftButton <> MouseButtonState.Pressed AndAlso _
      (currentStylus Is Nothing OrElse currentStylus.InAir) Then
        Return
    End If
    
    selectionMode = Not selectionMode
    
    ' If the control is in selection mode, change the color of 
    ' the current stroke dark gray.
    If selectionMode Then
        dynamicRenderer1.DrawingAttributes.Color = Colors.DarkGray
    
    Else
        dynamicRenderer1.DrawingAttributes.Color = Colors.Purple
    End If 
    
    dynamicRenderer1.Reset(currentStylus, stylusPoints)

End Sub 'ToggleSelect

Remarques

Le DynamicRenderer redessine le trait actuel et l’un des points du stylet passés dans Reset la méthode.The DynamicRenderer redraws the current stroke and any of the stylus points passed into the Reset method. Cette méthode vous permet de redessiner un trait pendant que l’utilisateur crée encore le trait.This method allows you to redraw a stroke while the user is still creating the stroke. Le stylet du Tablet PC doit toucher le digitaliseur ou le bouton gauche de la souris Reset doit être enfoncé lorsque est appelé.The tablet pen must be touching the digitizer or the left mouse button must be pressed when Reset is called.

Notes pour les héritiers

Lors d’une Reset(StylusDevice, StylusPointCollection) substitution dans une classe dérivée, veillez à appeler la Reset(StylusDevice, StylusPointCollection) méthode de la classe de base.When overriding Reset(StylusDevice, StylusPointCollection) in a derived class, be sure to call the base class' Reset(StylusDevice, StylusPointCollection) method.

S’applique à