【问题标题】:Stylus ink pressure is not working手写笔墨水压力不工作
【发布时间】:2013-02-02 02:05:44
【问题描述】:

我正在尝试将 Ink 功能应用到我的 Windows 应用商店应用。

基于Simplified Ink Sample in MSDN(注意我使用的是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;

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

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

【问题讨论】:

    标签: c# windows-runtime windows-store-apps microsoft.ink


    【解决方案1】:

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

    【讨论】:

    • // 感谢您的回复。我期待着得到答复。然后,我怎样才能在上面显示各种宽度的笔画?还有其他XamlInkRenderer 的例子吗?
    • 我不知道。 Project Austin 有一些 C++ 代码用于生成宽度可变的笔画,但我还没有考虑将其移植到 C#。
    猜你喜欢
    • 1970-01-01
    • 2017-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-21
    • 1970-01-01
    • 2021-06-25
    相关资源
    最近更新 更多