When I start to draw signature on signature pad (Wacom intuous M tablet) it should only access the canvas to draw the signature, but it is accessing the whole system maybe because I downloaded the driver of Wacom so I only want the pen to access the Canvas when I run the WPF Application
<Canvas x:Name="signatureCanvas" Background="White"
MouseDown="SignatureCanvas_OnMouseDown"
MouseMove="SignatureCanvas_OnMouseMove"
MouseUp="signatureCanvas_MouseUp"
SizeChanged="signatureCanvas_SizeChanged" Margin="30,20,30,49" />
I tried using mouse events so that it draws a signature on canvas:
private bool isDrawing = false;
private System.Windows.Point startPoint;
private void SignatureCanvas_OnMouseDown(object sender, MouseButtonEventArgs e)
{
isDrawing = true;
startPoint = e.GetPosition(signatureCanvas);
}
private void SignatureCanvas_OnMouseMove(object sender, MouseEventArgs e)
{
if (isDrawing)
{
Line line = new Line
{
Stroke = System.Windows.Media.Brushes.Black,
StrokeThickness = 2.5,
X1 = startPoint.X,
Y1 = startPoint.Y,
X2 = e.GetPosition(signatureCanvas).X,
Y2 = e.GetPosition(signatureCanvas).Y
};
startPoint = e.GetPosition(signatureCanvas);
signatureCanvas.Children.Add(line);
}
}
private void signatureCanvas_MouseUp(object sender, MouseButtonEventArgs e)
{
isDrawing = false;
}