Sdílet prostřednictvím


InkCollectorNewPacketsEventArgs.Stroke Property

Gets the Stroke object that generated the NewPackets event.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public ReadOnly Property Stroke As Stroke
'Usage
Dim instance As InkCollectorNewPacketsEventArgs 
Dim value As Stroke 

value = instance.Stroke
public Stroke Stroke { get; }
public:
property Stroke^ Stroke {
    Stroke^ get ();
}
public function get Stroke () : Stroke

Property Value

Type: Microsoft.Ink.Stroke
The object that generated the NewPackets event.

Examples

In this example, an InkCollectorNewPacketsEventHandler instance obtains the X and Y values of the last packet passed via the InkCollectorNewPacketsEventArgs object. The X and Y values are always in the first two positions of the packet data.

Private Sub mInkObject_NewPackets2(ByVal sender As Object, ByVal e As InkCollectorNewPacketsEventArgs)
    Dim DescriptorsPerPacket As Integer = e.Stroke.PacketDescription.Length
    Dim LastX As Integer = e.PacketData(DescriptorsPerPacket * (e.PacketCount - 1))
    Dim LastY As Integer = e.PacketData((DescriptorsPerPacket * (e.PacketCount - 1)) + 1)
End Sub
private void mInkObject_NewPackets2(object sender, InkCollectorNewPacketsEventArgs e)
{

    int DescriptorsPerPacket = e.Stroke.PacketDescription.Length;
    int LastX = e.PacketData[DescriptorsPerPacket * (e.PacketCount - 1)];
    int LastY = e.PacketData[(DescriptorsPerPacket * (e.PacketCount - 1)) + 1];

}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkCollectorNewPacketsEventArgs Class

InkCollectorNewPacketsEventArgs Members

Microsoft.Ink Namespace

InkCollector.NewPackets