InkManager.ProcessPointerUpdate(PointerPoint) 方法

定义

注意

对于使用可扩展应用程序标记语言 (XAML) 的通用 Windows 应用,建议使用 InkPresenterInkCanvas 控件,而不是 InkManager

处理指定指针的位置和状态属性,如压力和倾斜,从最后一个指针事件到并包括当前指针事件。在 ProcessPointerDown 之后和 ProcessPointerUp 之前调用此方法。

重要

桌面应用不支持此方法。

public:
 virtual Platform::Object ^ ProcessPointerUpdate(PointerPoint ^ pointerPoint) = ProcessPointerUpdate;
IInspectable ProcessPointerUpdate(PointerPoint const& pointerPoint);
public object ProcessPointerUpdate(PointerPoint pointerPoint);
function processPointerUpdate(pointerPoint)
Public Function ProcessPointerUpdate (pointerPoint As PointerPoint) As Object

参数

pointerPoint
PointerPoint

要处理其更新的输入指针。

返回

Object

Platform::Object

IInspectable

当当前 InkManipulationMode“墨迹书写”或“选择”时,此方法返回与指针点的最后一个 ProcessPointerUpdate 关联的墨迹空间中的) (屏幕位置。

示例

以下示例演示 InkCanvas 上 PointerMoved 事件的处理程序。

此处,自上次更新以来 (intermediatePoints) 未处理的中间点由 InkManager (inkManager ProcessPointerUpdate 调用中的) 进行处理。

void InkingArea_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
    var pointerPoint = e.GetCurrentPoint(InkingArea);

    if (pointerId == (int)pointerPoint.PointerId)
    {
        switch (inkManager.Mode)
        {
            case Windows.UI.Input.Inking.InkManipulationMode.Erasing:
                // Check if something has been erased.
                // In erase mode, ProcessPointerUpdate returns an 
                // `invalidateRect` (if it is not degenerate something 
                // has been erased). In erase mode we don't bother processing 
                // intermediate points.
                var invalidateRect = 
                    (Windows.Foundation.Rect)inkManager.ProcessPointerUpdate(
                        e.GetCurrentPoint(InkingArea));
                if (invalidateRect.Height != 0 && invalidateRect.Width != 0)
                {
                    // We don't know what has been erased so we clear the render
                    // and add back all the ink saved in the ink manager.
                    renderer.Clear();
                    renderer.AddInk(inkManager.GetStrokes());
                }
                break;

            case Windows.UI.Input.Inking.InkManipulationMode.Inking:
            case Windows.UI.Input.Inking.InkManipulationMode.Selecting:
                // Process intermediate points.
                var intermediatePoints = e.GetIntermediatePoints(InkingArea);
                for (int i = intermediatePoints.Count - 1; i >= 0; i--)
                {
                    inkManager.ProcessPointerUpdate(intermediatePoints[i]);
                }

                // Live rendering.
                renderer.UpdateLiveRender(pointerPoint);
                break;
        }
    }
}

适用于

另请参阅