Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Why this is happening</strong></p> <p>The custom InkCanvas in the example draws an ellipse at every collected StrokePoint but makes no attempt to draw lines between them. The standard InkCanvas control is implemented by drawing lines between the points it is given. This is why the custom InkCanvas implementation from the example leaves gaps and the built-in one doesn't.</p> <p><strong>How to "fix" it</strong></p> <p>The custom code could easily be extended to not leave gaps: In addition to drawing ellipses at each point, it could draw lines between each pair of points.</p> <p>Code to draw connecting lines might be added before the code to draw the ellipses, like this:</p> <pre><code>// Draw connecting lines var geo = new StreamGeometry(); using(geoContext = geo.Open()) { geoContext.StartFigure(stylusPoints[0], false, false); geoContext.PolyLineTo(stylusPoints.Skip(1).Cast&lt;Point&gt;(), true, false); } drawingContext.DrawGeometry(null, connectingLinePen, geo); // Draw ellipses for(int i = 1; i &lt; stylusPoints.Count; i++) { ... etc ... </code></pre> <p>This code works by constructing a polyline StreamGeometry and then drawing it to the context. Using a StreamGeometry in this context is generally more efficient than creating a PathGeometry with a Polyline or doing a bunch of DrawLine calls directly on the drawingCanvas.</p> <p>Note: Using a better digitizer won't solve the underlying problem, which is that the custom InkCanvas is actually designed to only show data at the sampled points and not in between.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload