Exemplo n.º 1
0
        /// <summary>
        ///     Provides all of the known points the device hit since the last reported position update.
        /// </summary>
        /// <param name="relativeTo">Defines the coordinate space.</param>
        /// <returns>A list of points in the coordinate space of relativeTo.</returns>
        public override TouchPointCollection GetIntermediateTouchPoints(IInputElement relativeTo)
        {
            // Retrieve the stylus points
            StylusPointCollection stylusPoints = StylusDevice.GetStylusPoints(relativeTo, _stylusPointDescription);
            int count = stylusPoints.Count;
            TouchPointCollection touchPoints = new TouchPointCollection();

            GeneralTransform elementToRoot;
            GeneralTransform rootToElement;

            GetRootTransforms(relativeTo, out elementToRoot, out rootToElement);

            // Convert the stylus points into touch points
            for (int i = 0; i < count; i++)
            {
                StylusPoint stylusPoint = stylusPoints[i];
                Point       position    = new Point(stylusPoint.X, stylusPoint.Y);
                Rect        rectBounds  = GetBounds(stylusPoint, position, relativeTo, elementToRoot, rootToElement);

                TouchPoint touchPoint = new TouchPoint(this, position, rectBounds, _lastAction);
                touchPoints.Add(touchPoint);
            }

            return(touchPoints);
        }
Exemplo n.º 2
0
 public StylusPointCollection GetStylusPoints(IInputElement relativeTo)
 {
     return(StylusDevice.GetStylusPoints(relativeTo));
 }
Exemplo n.º 3
0
 public StylusPointCollection GetStylusPoints(IInputElement relativeTo,
                                              StylusPointDescription subsetToReformatTo)
 {
     return(StylusDevice.GetStylusPoints(relativeTo, subsetToReformatTo));
 }