Export (0) Print
Expand All

GetStylusPoints Method

Returns a clone of the stylus points collected since the last mouse event.

XAML
Cannot use methods in XAML.
Scripting
retval = eventargs.GetStylusPoints(inkPresenter)

Parameters

inkPresenter

InkPresenter

The coordinates of the StylusPoints that are returned are relative to the InkPresenter that is passed into the method.

Return Value

StylusPointCollection

A collection of the stylus points collected since the last mouse event.

Remarks

If the active device is a mouse, the returned StylusPointCollection will contain a single point corresponding to the mouse event.

Examples

In this example the x and y coordinates of each StylusPoint are sent to a TextBlock as they are added to a stroke.

JavaScript
// Add the new points to the Stroke we're working with and display the StylusPoint coordinates.
function InkPresenterMouseMove(sender,args)
{
   if (newStroke != null)
   {
      newStroke.StylusPoints.AddStylusPoints(args.GetStylusPoints(inkPresenter));
      xCoord.Text = "" + args.GetStylusPoints(inkPresenter).GetItem(0).X;
      yCoord.Text = "" + args.GetStylusPoints(inkPresenter).GetItem(0).Y;
      pressureData.Text = "" + args.GetStylusPoints(inkPresenter).GetItem(0).PressureFactor;
   }
}

Applies To

MouseEventArgs

See Also

Ink Support In Microsoft Silverlight

Community Additions

Show:
© 2015 Microsoft