Windows Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize
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

Provides properties associated with the drawing of an InkStroke.

Syntax


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

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.

 

Properties

The InkDrawingAttributes class has these properties.

PropertyAccess typeDescription

Color

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

DrawAsHighlighter

Read/writeGets or sets a value that indicates whether the InkStroke is rendered as a translucent overlay. The stroke is typically set to a bright color, such as yellow.

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 contact 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.

PenTipTransform

Read/writeGets or sets a value that indicates a 3x2 transformation matrix applied to the PenTipShape used for an InkStroke.

Size

Read/writeGets or sets a value that indicates the dimensions of the pen tip (PenTip) 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.

Note  You cannot set the DrawingAttributes property of the stroke directly. You must create a copy of the InkDrawingAttributes of the stroke, set the desired values for that InkDrawingAttributes object, and then assign the new InkDrawingAttributes to the DrawingAttributes of the stroke, as shown here.
 

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 (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

Attributes

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

See also

Object
Windows.UI.Input.Inking Classes
Pen and stylus interactions
Samples
Ink sample
Simple ink sample
Complex ink sample

 

 

Show:
© 2015 Microsoft