#481 – You Can Draw On an InkCanvas Control with the Mouse

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>

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

2 Responses to #481 – You Can Draw On an InkCanvas Control with the Mouse

  1. Pingback: Dew Drop – January 26, 2012 (#1,251) | Alvin Ashcraft's Morning Dew

  2. Pingback: #482 – You Can Include Other Controls Inside an InkCanvas « 2,000 Things You Should Know About WPF

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: