Class InkTrace
Represents a single ink trace (one continuous stroke). A trace
contains an ordered list of InkTracePoint values.
Maps to an InkML <trace> element.
Inherited Members
Namespace: DRIT.Presentation.Drawing
Assembly: DRIT.Presentation.dll
Syntax
public class InkTrace
Constructors
InkTrace()
Initializes a new empty trace.
Declaration
public InkTrace()
InkTrace(IEnumerable<InkTracePoint>)
Initializes a new trace with the specified points.
Declaration
public InkTrace(IEnumerable<InkTracePoint> points)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<InkTracePoint> | points |
Properties
BrushRef
Gets or sets an optional brush reference for this trace.
When null, the parent Ink's Brush
applies. Maps to the InkML <trace> element's
brushRef attribute.
Declaration
public string BrushRef { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Id
Gets or sets an optional trace identifier. Maps to the
InkML <trace> element's id attribute.
Declaration
public string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
PointCount
Gets the number of points in this trace.
Declaration
public int PointCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Points
Gets the read-only list of points in this trace. Use AddPoint(double, double) or AddPoints(IEnumerable<InkTracePoint>) to populate the trace.
Declaration
public IReadOnlyList<InkTracePoint> Points { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<InkTracePoint> |
Methods
AddPoint(InkTracePoint)
Adds a pre-constructed point to the end of this trace.
Declaration
public void AddPoint(InkTracePoint point)
Parameters
| Type | Name | Description |
|---|---|---|
| InkTracePoint | point |
AddPoint(double, double)
Adds a point to the end of this trace.
Declaration
public InkTracePoint AddPoint(double x, double y)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | |
| double | y |
Returns
| Type | Description |
|---|---|
| InkTracePoint |
AddPoint(double, double, double)
Adds a point with pressure to the end of this trace.
Declaration
public InkTracePoint AddPoint(double x, double y, double pressure)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | |
| double | y | |
| double | pressure |
Returns
| Type | Description |
|---|---|
| InkTracePoint |
AddPoints(IEnumerable<InkTracePoint>)
Adds multiple points to the end of this trace.
Declaration
public void AddPoints(IEnumerable<InkTracePoint> points)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<InkTracePoint> | points |
Clear()
Removes all points from this trace.
Declaration
public void Clear()
ParseTraceData(string)
Parses an InkML trace body string into a list of points.
The format is comma-separated coordinate tuples, e.g.
"10 20, 30 40, 50 60".
Declaration
public static List<InkTracePoint> ParseTraceData(string data)
Parameters
| Type | Name | Description |
|---|---|---|
| string | data |
Returns
| Type | Description |
|---|---|
| List<InkTracePoint> |
ToInkMLTraceData()
Returns the trace formatted as an InkML <trace>
body string (comma-separated coordinate tuples).
Declaration
public string ToInkMLTraceData()
Returns
| Type | Description |
|---|---|
| string |