PointerRoutedEventArgs.GetIntermediatePoints method

Applies to Windows and Windows Phone

Retrieves a collection of PointerPoint objects that represent the pointer history from the last pointer event up to and including the current pointer event. Each PointerPoint in the collection provides basic info on the pointer associated with the event.

The last item in the collection is equivalent to the PointerPoint object returned by GetCurrentPoint.

Syntax


public IList<PointerPoint> GetIntermediatePoints(
  UIElement relativeTo
)

Parameters

relativeTo

Type: UIElement

Provides the context for the pointer data.

Can be any UIElement-derived object that is connected to the same object tree. If null, location coordinates are in the context of the app.

Return value

Type: IVector<PointerPoint> [C++] | System.Collections.Generic.IList<PointerPoint> [.NET]

The collection of PointerPoint objects corresponding to the pointer history associated with the event. If relativeTo is null, location coordinates are in the context of the app. Otherwise, the coordinates are relative to the object referenced by relativeTo.

Remarks

The objects retrieved by this method provide access to extended pointer info through the Properties property, which gets a PointerPointProperties object.

In the following example, we get extended pointer properties through the PointerPoint and PointerPointProperties objects. (See Quickstart: Pointers for the complete example.)


         String queryPointer(PointerPoint ptrPt)
         {
             String details = "";

             switch (ptrPt.PointerDevice.PointerDeviceType)
             {
                 case Windows.Devices.Input.PointerDeviceType.Mouse:
                     details += "\nPointer type: mouse";
                     break;
                 case Windows.Devices.Input.PointerDeviceType.Pen:
                     details += "\nPointer type: pen";
                     if (ptrPt.IsInContact)
                     {
                         details += "\nPressure: " + ptrPt.Properties.Pressure;
                         details += "\nrotation: " + ptrPt.Properties.Orientation;
                         details += "\nTilt X: " + ptrPt.Properties.XTilt;
                         details += "\nTilt Y: " + ptrPt.Properties.YTilt;
                         details += "\nBarrel button pressed: " + ptrPt.Properties.IsBarrelButtonPressed;
                     }
                     break;
                 case Windows.Devices.Input.PointerDeviceType.Touch:
                     details += "\nPointer type: touch";
                     details += "\nrotation: " + ptrPt.Properties.Orientation;
                     details += "\nTilt X: " + ptrPt.Properties.XTilt;
                     details += "\nTilt Y: " + ptrPt.Properties.YTilt;
                     break;
                 default:
                     details += "\nPointer type: n/a";
                     break;
             }

             GeneralTransform gt = Target.TransformToVisual(page);
             Point screenPoint;

             screenPoint = gt.TransformPoint(new Point(ptrPt.Position.X, ptrPt.Position.Y));
             details += "\nPointer Id: " + ptrPt.PointerId.ToString() +
                 "\nPointer location (parent): " + ptrPt.Position.X + ", " + ptrPt.Position.Y +
                 "\nPointer location (screen): " + screenPoint.X + ", " + screenPoint.Y;
             return details;
         }


Typically, the objects returned by this method are used to feed pointer data to a GestureRecognizer.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Input
Windows::UI::Xaml::Input [C++]

Metadata

Windows.winmd

See also

PointerRoutedEventArgs

 

 

Show:
© 2014 Microsoft