共用方式為


InkManager.ProcessPointerUpdate(PointerPoint) 方法

定義

注意

針對使用可延伸應用程式標記語言的通用 Windows 應用程式 (XAML) ,我們建議使用 InkPresenterInkCanvas 控制項,而不是 InkManager

處理指定指標的位置和狀態屬性,例如壓力和傾斜,從最後一個指標事件到目前指標事件,並包括目前的指標事件。在 ProcessPointerDownProcessPointerUp之前呼叫此方法。

重要

傳統型應用程式中不支援此方法。

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筆跡選取時,這個方法會傳回筆跡空間中的 Point (畫面位置,) 與 pointerPoint的最後一個 ProcessPointerUpdate 相關聯。

範例

下列範例示範 InkCanvas 上 PointerMoved 事件的處理常式。

在這裡,在 ProcessPointerUpdate 呼叫中,InkManagerinkManager () 會處理自上次更新後) 未處理的中繼 (intermediatePoints 點。

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

適用於

另請參閱