Represents a single point collected while the user is entering ink strokes with the stylus or mouse.
Assembly: System.Windows (in System.Windows.dll)
Thetype exposes the following members.
|Equals||Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Returns the hash code for this instance. (Inherited from ValueType.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns the fully qualified type name of this instance. (Inherited from ValueType.)|
The structure represents a single point. All objects contain properties that indicate the (x, y) coordinates and the pressure.
The following code example displays the x-coordinate, y-coordinate, and pressure data of each stylus point as they are added to a stroke.
Public Sub New() MyBase.New() InitializeComponent() SetBoundary() End Sub 'A new stroke object, MyStroke, is created and is added to the StrokeCollection object 'of the InkPresenter, MyIP Private Sub MyIP_MouseLeftButtonDown(ByVal sender As Object, ByVal e As MouseEventArgs) MyIP.CaptureMouse() Dim MyStylusPointCollection As StylusPointCollection = New StylusPointCollection MyStylusPointCollection.Add(e.StylusDevice.GetStylusPoints(MyIP)) MyStroke = New Stroke(MyStylusPointCollection) MyIP.Strokes.Add(MyStroke) End Sub 'StylusPoint objects are collected from the MouseEventArgs and added to MyStroke Private Sub MyIP_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) If (Not (MyStroke) Is Nothing) Then MyStroke.StylusPoints.Add(e.StylusDevice.GetStylusPoints(MyIP)) XTB.Text = ("" + e.StylusDevice.GetStylusPoints(MyIP)(0).X) YTB.Text = ("" + e.StylusDevice.GetStylusPoints(MyIP)(0).Y) PressureTB.Text = ("" + e.StylusDevice.GetStylusPoints(MyIP)(0).PressureFactor) End If End Sub 'MyStroke is completed Private Sub MyIP_LostMouseCapture(ByVal sender As Object, ByVal e As MouseEventArgs) MyStroke = Nothing End Sub Private Sub SetBoundary() Dim MyRectangleGeometry As RectangleGeometry = New RectangleGeometry MyRectangleGeometry.Rect = New Rect(0, 0, MyIP.ActualHeight, MyIP.ActualWidth) MyIP.Clip = MyRectangleGeometry End Sub
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.