Share via


InkModelerAttributes 类

定义

管理 InkPresenter 对象可以处理哪些类型的墨迹建模器属性。

public ref class InkModelerAttributes sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 393216)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class InkModelerAttributes final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 393216)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class InkModelerAttributes
Public NotInheritable Class InkModelerAttributes
继承
Object Platform::Object IInspectable InkModelerAttributes
属性

Windows 要求

设备系列
Windows 10, version 1803 (在 10.0.17134.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v6.0 中引入)

示例

此处,我们展示了如何使用呈现墨迹笔划时增加延迟来减少由于错误预测而可能出现的笔划更正项目。 此示例将默认的前瞻性预测时间从 15 毫秒减少到 8 毫秒。

public sealed partial class AdjustPrediction : Page
{
    public AdjustPrediction()
    {
        this.InitializeComponent();
        var inkPresenter = inkCanvas.InkPresenter;
        InkDrawingAttributes drawingAttributes =
            inkPresenter.CopyDefaultDrawingAttributes();
        InkModelingAttributes modelingAttributes = drawingAttributes.ModelingAttributes;
        modelingAttributes.PredictionTime = TimeSpan.FromMilliseconds(8);
        inkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
    }
}

注解

墨迹建模是指处理和优化输入以墨迹笔划呈现的过程。 这可以支持筛选、平滑、预测 (以减少感知的延迟) ,以及转换 ((如缩放显示 DPI)或将指针压力映射到笔划宽度) 。

使用 InkToolbar 时,应在 InkToolbar.ActiveToolChanged 事件中设置 InkModelerAttributes,因为只要更改活动工具,属性就会被覆盖。

版本历史记录

Windows 版本 SDK 版本 已添加值
2004 19041 UseVelocityBasedPressure

属性

PredictionTime

获取或设置将来用于预测输入指针的预期位置的时间量。

ScalingFactor

获取或设置墨迹笔划坐标空间的缩放转换。

UseVelocityBasedPressure

获取或设置是否将笔速度与墨迹表面上的压力结合使用来计算最终压力值。

适用于

另请参阅