0

I am trying to apply Ink capability to my Windows Store App.

Based on the Simplified Ink Sample in MSDN (note that I use C# sample), I modified the 51st line in Scenario1.xaml.cs, drawingAttributes.IgnorePressure = false; in order to use Stylus Pressure.

FYI, below part is the code block from line 46~52.

        // Initialize drawing attributes. These are used in inking mode.
        drawingAttributes = new Windows.UI.Input.Inking.InkDrawingAttributes();
        drawingAttributes.Color = Windows.UI.Colors.Red;
        double penSize = 2 + 2*PenThickness.SelectedIndex;
        drawingAttributes.Size = new Windows.Foundation.Size(penSize, penSize);
        drawingAttributes.IgnorePressure = false;
        drawingAttributes.FitToCurve = true;

But the stroke thickness was not changed as I expected. I added drawingAttributes.PenTip = PenTipShape.Circle; right after the 51st line but the pressure does not be affected.

Do I miss something? My stylus is working properly with Fresh Paint app or other pressure-sensitive apps (I'm using Lenovo x230t tablet).

leesei
  • 6,020
  • 2
  • 29
  • 51
Youngjae
  • 24,352
  • 18
  • 113
  • 198

1 Answers1

0

The XamlInkRenderer in that sample ignores the DrawingAttribute.Pressure when drawing the strokes. Each stroke is drawn with constant width so even though the pressure is recorded it isn't used.

Jesper Larsen-Ledet
  • 6,625
  • 3
  • 30
  • 42
  • // Thanks for the reply. I was looking forward to get the reply. And then, how can I display various width stroke on that? Is there any other `XamlInkRenderer` example? – Youngjae Apr 25 '13 at 01:22
  • Not that I know of. [Project Austin](http://blogs.msdn.com/b/vcblog/archive/2012/09/11/10348466.aspx) has some C++ code for generating strokes with variable width but I haven't looked at porting it to C# yet. – Jesper Larsen-Ledet Apr 25 '13 at 13:16