I have sketchpad as InkCanvas
; I want to change size of eraser so I've written:
Private Sub Sketchpad_KeyDown(sender As System.Object, e As System.Windows.Input.KeyEventArgs) Handles Sketchpad.KeyDown
If e.Key = Key.OemMinus Then
' Decrease size of Eraser to 5*5
Sketchpad.EraserShape = New RectangleStylusShape(5, 5)
End If
If e.Key = Key.OemPlus Then
' Increase size of Eraser to 50*50
Sketchpad.EraserShape = New RectangleStylusShape(50, 50)
End If
If e.Key = Key.I Then
' Change editing mode to Ink
Sketchpad.EditingMode = InkCanvasEditingMode.Ink
End If
If e.Key = Key.E Then
' Change editing mode to Eraser
Sketchpad.EditingMode = InkCanvasEditingMode.EraseByPoint
End If
End Sub
Try this:
- Select eraser by pressing e, Eraser stylusTip will appears Rectangular
- Press + sign to increase size , you will not see any changes. Why?
- Now you press i to change editing mode, ink tip will appears.
- Press e again to reswitch to Eraser. You will see that eraser shape has been changed.
Why not after pressing + sign?