Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

InkDrawingAttributes class

Applies to Windows only

Provides properties associated with the drawing of an InkStroke.

Syntax


var inkDrawingAttributes = new Windows.UI.Input.Inking.InkDrawingAttributes();

Attributes

[DualApiPartition()]
[MarshalingBehavior(None)]
[Threading(Both)]
[Version(0x06020000)]

Members

The InkDrawingAttributes class has these types of members:

Constructors

The InkDrawingAttributes class has these constructors.

ConstructorDescription
InkDrawingAttributes Creates a new InkDrawingAttributes object that is used to specify InkStroke attributes.

 

Methods

The InkDrawingAttributes class inherits methods from the Object class (C#/VB/C++).

Properties

The InkDrawingAttributes class has these properties.

PropertyAccess typeDescription

Color

Read/writeGets or sets a value that indicates the color of an InkStroke.

FitToCurve

Read/writeGets or sets a value that indicates whether Bezier curves or straight line segments are used to draw an InkStroke.

IgnorePressure

Read/writeGets or sets a value that indicates whether the pressure of the pen tip on the digitizer surface is ignored when you draw an InkStroke.

PenTip

Read/writeGets or sets a value that indicates the shape of the pen tip when you draw an InkStroke.

Size

Read/writeGets or sets a value that indicates the dimensions of the pen tip when you draw an InkStroke.

 

Remarks

InkDrawingAttributes can be set globally through the SetDefaultDrawingAttributes method of an InkManager object or an InkStrokeBuilder object. They can also be set on an individual InkStroke object through the DrawingAttributes property.

Note  : This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).

Examples

The following example demonstrates how to set a default drawing attribute for all strokes managed by an InkManager object (inkManager).



var inkManager = new Windows.UI.Input.Inking.InkManager();
var drawingAttributes = 
     new Windows.UI.Input.Inking.InkDrawingAttributes();
// True is the Default value for fitToCurve.
drawingAttributes.fitToCurve = false;
// Set color to red (default is black).
drawingAttributes.color = 
     Windows.UI.ColorHelper.fromArgb(255, 255, 0, 0); 
inkManager.setDefaultDrawingAttributes(drawingAttributes);

The following example demonstrates how to set a drawing attribute for a specific stroke.


inkManager.getStrokes().forEach(function (stroke)
{
  var drawingAttributes = stroke.drawingAttributes;
  drawingAttributes.penTip = 
       Windows.UI.Input.Inking.PenTipShape.rectangle;
  stroke.drawingAttributes = drawingAttributes;
}

For the complete example, see Ink App sample.

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

None supported

Namespace

Windows.UI.Input.Inking
Windows::UI::Input::Inking [C++]

Metadata

Windows.winmd

See also

Windows.UI.Input.Inking Classes
Responding to pen and stylus input
Ink App sample

 

 

Show:
© 2014 Microsoft. All rights reserved.