SurfaceInkCanvas.DefaultDrawingAttributes Property

Gets or sets the drawing attributes that are applied to new ink strokes on a SurfaceInkCanvas object.

Namespace: Microsoft.Surface.Presentation.Controls
Assembly: Microsoft.Surface.Presentation (in Microsoft.Surface.Presentation)


Public Property DefaultDrawingAttributes As DrawingAttributes
/** @property */
public DrawingAttributes get_DefaultDrawingAttributes ()

/** @property */
public void set_DefaultDrawingAttributes (DrawingAttributes value)

public function get DefaultDrawingAttributes () : DrawingAttributes

public function set DefaultDrawingAttributes (value : DrawingAttributes)

Property Value

Returns DrawingAttributes.

In the following code example, the DefaultDrawingAttributes property is modified to produce red strokes of the specified height and width.

MainInkCanvas.DefaultDrawingAttributes.Color = Colors.Red;
MainInkCanvas.DefaultDrawingAttributes.Height = 33;
MainInkCanvas.DefaultDrawingAttributes.Width = 17;
// Must set UsesTouchShape = false or the Height and Width
// established above will not be used in rendering strokes.
MainInkCanvas.UsesTouchShape = false;

Ink-related classes are located within the System.Windows.Ink namespace.

using System.Windows.Ink;

The DefaultDrawingAttributes property is a dependency property that is identified by the DefaultDrawingAttributesProperty field.

You can use the DefaultDrawingAttributes property to establish the color, size, and other aspects of the rendered stroke.

When UsesTouchShape is true, modifying the Height and Width of the DefaultDrawingAttributes property has no effect. When you want to change the size of the rendered stroke by modifying the DefaultDrawingAttributes property, you must also set UsesTouchShape to false.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.



Operating System (OS)Windows 7
Software Developer Kit (SDK)Surface 2.0
.NET Framework 4
Developer environmentVisual Studio 2010, Express or full edition
Microsoft Expression Blend 4.0 (optional)
End-user hardwareDevices made for Surface 2.0, or
Windows Touch computers

Did you find this information useful? Please send us your suggestions and comments.

© Microsoft Corporation. All rights reserved.