Share via


Ink.CreateStroke Method (array<Point[])

Creates a Stroke object from an array of Point input values.

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

Syntax

'Declaration
Public Function CreateStroke ( _
    points As Point() _
) As Stroke
'Usage
Dim instance As Ink 
Dim points As Point()
Dim returnValue As Stroke 

returnValue = instance.CreateStroke(points)
public Stroke CreateStroke(
    Point[] points
)
public:
Stroke^ CreateStroke(
    array<Point>^ points
)
public function CreateStroke(
    points : Point[]
) : Stroke

Parameters

Return Value

Type: Microsoft.Ink.Stroke
The newly created stroke.
The newly created Stroke object.

Remarks

The minimum and maximum values of any point in the points array are the System.Int32.MinValue and System.Int32.MaxValue fields, respectively. However, these points define an ink space rectangle whose maximum width or height cannot exceed System.Int32.MaxValue. Because of this, the difference between the minimum and maximum x-coordinates or the minimum and maximum y-coordinates cannot exceed System.Int32.MaxValue.

Examples

In this example, a Stroke object is created in an Ink object. The stroke runs from the top left corner of the ink area to the bottom right corner.

' get the bottom right point of the client area for ink 
' Note: InkOverlay.AttachedControl property must be set 
Dim bottomRight As Point = New Point(mInkOverlay.AttachedControl.ClientSize)
' convert to HIMETRIC units 
Using g As Graphics = mInkOverlay.AttachedControl.CreateGraphics()
    mInkOverlay.Renderer.PixelToInkSpace(g, bottomRight)
End Using 
' create the stroke 
Dim strokePoints As Point() = New Point(1) {New Point(0), bottomRight}
mInkOverlay.Ink.CreateStroke(strokePoints)
mInkOverlay.AttachedControl.Invalidate()
// get the bottom right point of the client area for ink 
// Note: InkOverlay.AttachedControl property must be set
Point bottomRight = new Point(mInkOverlay.AttachedControl.ClientSize);
// convert to HIMETRIC units 
using (Graphics g = mInkOverlay.AttachedControl.CreateGraphics())
{
    mInkOverlay.Renderer.PixelToInkSpace(g, ref bottomRight);
}
// create the stroke
Point[] strokePoints = new Point[2] { new Point(0), bottomRight };
mInkOverlay.Ink.CreateStroke(strokePoints);
mInkOverlay.AttachedControl.Invalidate();

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

Ink Class

Ink Members

CreateStroke Overload

Microsoft.Ink Namespace

Stroke

TabletPropertyDescriptionCollection.InkToDeviceScaleX

TabletPropertyDescriptionCollection.InkToDeviceScaleY

Ink.CreateStrokes

Ink.DeleteStroke

Ink.DeleteStrokes