0

我正在尝试将 Ink 功能应用于我的 Windows Store 应用程序。

基于MSDN 中的 Simplified Ink Sample(注意我使用 C# 示例),我修改了 Scenario1.xaml.cs 中的第 51 行,drawingAttributes.IgnorePressure = false;以便使用 Stylus Pressure。

仅供参考,下面是第 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;

但笔画粗细并没有像我预期的那样改变。我drawingAttributes.PenTip = PenTipShape.Circle;在第 51 行之后立即添加,但压力不受影响。

我错过了什么吗?我的手写笔与 Fresh Paint 应用程序或其他压力敏感应用程序(我使用的是联想 x230t 平板电脑)正常工作。

4

1 回答 1

0

该示例中的 XamlInkRenderer 在绘制笔划时会忽略 DrawingAttribute.Pressure。每个笔画都以恒定宽度绘制,因此即使记录了压力,也不会使用它。

于 2013-04-24T09:00:18.940 回答