The DrawTool is one of the tools that come out-of-the-box with the RadImageEditor and enables you to draw over the image. You can choose different brush color and size. The tool provides some customization options that are explained in detail in this topic.
Similarly to the other RadImageEditor tools, the DrawTool is located in the Telerik.Windows.Media.Imaging.Tools namespace, inherits the DrawToolBase class and can be defined in XAML as follows:
[XAML] Example 1: Define DrawTool
The DrawTool introduces the following two properties which can be set by declaring them in XAML as well:
DefaultBrushSize: Specifies the default size of the brush. The property is of type double.
DefaultBrushColor: Specifies the default brush color. The property is of type Color.
[XAML] Example 2: Customize DrawTool
<tools:DrawTool DefaultBrushColor="Blue" DefaultBrushSize="5"/>
[C#] Example 2: Customize DrawTool
DrawTool drawTool = new DrawTool(); drawTool.DefaultBrushColor = Colors.Blue; drawTool.DefaultBrushSize = 5;
[VB.NET] Example 2: Customize DrawTool
Dim drawTool = New DrawTool() drawTool.DefaultBrushColor = Colors.Blue drawTool.DefaultBrushSize = 5
The DrawTool introduces the following virtual methods which can be overridden in order to achieve different than the default behavior:
CreatePathFigure(Point currentPosition): Returns a PathFigure object which is added to the path’s geometry figures collection. The method is invoked at the beginning of the drawing right after the Path’s initialization.