0
我有画板作为InkCanvas
;我想,所以我已经写了改变橡皮擦尺寸:InkCanvas Eraser
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
试试这个:通过按e
- 选择橡皮擦,橡皮stylusTip会出现矩形
- 按下+号来增大尺寸,你不会看到任何改变。为什么?
- 现在您按i更改编辑模式,将出现墨水提示。
- 再次按e重新切换到橡皮擦。你会看到橡皮擦的形状已经改变。
为什么不按+符号后?
但它不是它应该工作,橡皮擦应该反映的变化,虽然我们不切换编辑模式,因为它适用于油墨体形的方式。 ink.EraserShape = new RectangleStylusShape(5,5); 应该工作,为什么不工作??? – 2011-04-19 09:08:12
你我可能不同意,但它是在MSDN中,所以它是一个已知和预期的功能。 – 2011-04-19 09:13:35