DynamicRenderer.Reset(StylusDevice, StylusPointCollection) Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee wordt de weergave op de huidige pennenstreek gewist en opnieuw getekend.
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
Public Overridable Sub Reset (stylusDevice As StylusDevice, stylusPoints As StylusPointCollection)
Parameters
- stylusDevice
- StylusDevice
Het huidige stylusapparaat.
- stylusPoints
- StylusPointCollection
De stylus wijst opnieuw te tekenen.
Uitzonderingen
De stylus of de muis bevindt zich niet in de downstatus.
Voorbeelden
In het volgende voorbeeld wordt de kleur van de huidige lijn gewijzigd terwijl deze wordt getekend.
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
Opmerkingen
De DynamicRenderer huidige lijn en een van de styluspunten die in de Reset methode zijn doorgegeven, worden opnieuw getekend. Met deze methode kunt u een pennenstreek opnieuw tekenen terwijl de gebruiker nog steeds de pennenstreek maakt. De tabletpen moet de digitalisatiefunctie raken of de linkermuisknop moet worden ingedrukt wanneer Reset deze wordt aangeroepen.
Notities voor overnemers
Wanneer u Reset(StylusDevice, StylusPointCollection) overschrijft in een afgeleide klasse, moet u de methode van de basisklasse Reset(StylusDevice, StylusPointCollection) aanroepen.