DynamicRenderer.Reset(StylusDevice, StylusPointCollection) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
현재 스트로크에서 렌더링을 지우고 다시 그어 줍니다.
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)
매개 변수
- stylusDevice
- StylusDevice
현재 스타일러스 디바이스입니다.
- stylusPoints
- StylusPointCollection
스타일러스가 다시 그려지도록 가리킵니다.
예외
스타일러스도 마우스도 아래쪽 상태가 아닙니다.
예제
다음은 현재 스트로크가 그려질 때 색을 변경하는 예제입니다.
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
설명
현재 DynamicRenderer 스트로크와 메서드에 Reset 전달된 스타일러스 점을 다시 그렸습니다. 이 메서드를 사용하면 사용자가 스트로크를 만드는 동안 스트로크를 다시 그릴 수 있습니다. 태블릿 펜은 디지타이저를 터치해야 하며, 호출될 때 Reset 왼쪽 마우스 단추를 눌러야 합니다.
상속자 참고
파생 클래스에서 재정의하는 Reset(StylusDevice, StylusPointCollection) 경우 기본 클래스의 Reset(StylusDevice, StylusPointCollection) 메서드를 호출해야 합니다.