مشاركة عبر


InkModelerAttributes Class

Definition

Manages which types of ink modeler attributes can be processed by the InkPresenter object.

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
Inheritance
Object Platform::Object IInspectable InkModelerAttributes
Attributes

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)

Examples

Here, we show how increasing latency when rendering ink strokes can be used to reduce possible stroke correction artifacts due to incorrect prediction. This example reduces the default forward-looking prediction time from 15ms to 8ms.

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);
    }
}

Remarks

Ink modeling refers to the process of processing and optimizing input for rendering as ink strokes. This can inlcude filtering, smoothing, prediction (to reduce perceived latency), and transformation (such as scaling for display DPI, or mapping pointer pressure to stroke width).

When using the InkToolbar, InkModelerAttributes should be set in the InkToolbar.ActiveToolChanged event as attributes are overwritten whenever the active tool is changed.

Version history

Windows version SDK version Value added
2004 19041 UseVelocityBasedPressure

Properties

PredictionTime

Gets or sets the amount of time into the future used to predict the expected location of the input pointer.

ScalingFactor

Gets or sets the scale transform for the coordinate space of the ink stroke.

UseVelocityBasedPressure

Gets or sets whether pen velocity is used in combination with pressure on the inking surface to calculate final pressure value.

Applies to

See also