#481 – You Can Draw On an InkCanvas Control with the Mouse
January 26, 2012 2 Comments
You can use the InkCanvas control to include an area of your user interface that users can draw on, using the mouse or a stylus.
By default, an InkCanvas allows drawing on its surface using the mouse. Each time that you click and drag with the mouse, you are creating a stroke, which is then stored with the InkCanvas.
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Content="Draw in the area below using your mouse" Margin="10,5"/>
<Border Grid.Row="1" BorderBrush="DodgerBlue" BorderThickness="2" Margin="10" SnapsToDevicePixels="True">
<InkCanvas/>
</Border>
</Grid>
Pingback: Dew Drop – January 26, 2012 (#1,251) | Alvin Ashcraft's Morning Dew
Pingback: #482 – You Can Include Other Controls Inside an InkCanvas « 2,000 Things You Should Know About WPF