SurfaceInkCanvas.DefaultDrawingAttributes Property

Surface 1.0 SP1
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.dll)

Dim instance As SurfaceInkCanvas
Dim value As DrawingAttributes

value = instance.DefaultDrawingAttributes

instance.DefaultDrawingAttributes = value

public DrawingAttributes DefaultDrawingAttributes { get; set; }
/** @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.

#region DefaultDrawingAttributes
this.InkCanvas.DefaultDrawingAttributes.Color = Colors.Red;
this.InkCanvas.DefaultDrawingAttributes.Height = 33;
this.InkCanvas.DefaultDrawingAttributes.Width = 17;
// Must set UsesContactShape = false or the Height and Width
// established earlier will not be used in rendering strokes.
this.InkCanvas.UsesContactShape = false;

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

#region UsingSystemWindowsInk
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 UsesContactShape 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 UsesContactShape 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.

Development Platforms

Microsoft Surface 1.0 SP1, Windows Vista Ultimate, Windows Vista Enterprise, Windows Vista Business

Target Platforms

Microsoft Surface 1.0 SP1