Condividi tramite


Metodo Ink.CreateStroke (array<Point[])

Aggiornamento: novembre 2007

Crea un oggetto Stroke da una matrice dei valori di input di Point.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Sintassi

'Dichiarazione
Public Function CreateStroke ( _
    points As Point() _
) As Stroke
'Utilizzo
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 Stroke CreateStroke(
    Point[] points
)
public function CreateStroke(
    points : Point[]
) : Stroke

Parametri

Valore restituito

Tipo: Microsoft.Ink.Stroke
Tratto appena creato.
Oggetto Stroke appena creato.

Note

I valori minimo e massimo di qualsiasi punto nella matrice dei punti sono rispettivamente i campi System.Int32.MinValue e System.Int32.MaxValue. Tuttavia, questi punti definiscono un rettangolo dello spazio di input penna la cui larghezza o altezza massime non può superare System.Int32.MaxValue. Per questo motivo, la differenza tra le coordinate x minime e massime o le coordinate y minime e massime non può superare System.Int32.MaxValue.

Esempi

In questo esempio viene creato un oggetto Stroke in un oggetto Ink. Il tratto è in esecuzione dall'angolo in alto a sinistra dell'area di input penna all'angolo in basso a destra.

' 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();

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

Ink Classe

Membri Ink

Overload CreateStroke

Spazio dei nomi Microsoft.Ink

Stroke

TabletPropertyDescriptionCollection.InkToDeviceScaleX

TabletPropertyDescriptionCollection.InkToDeviceScaleY

Ink.CreateStrokes

Ink.DeleteStroke

Ink.DeleteStrokes