Export (0) Print
Expand All

Stroke.Stroke(StylusPointCollection) Constructor

Initializes a new instance of the Stroke class.

Namespace: System.Windows.Ink
Assembly: PresentationCore (in presentationcore.dll)

public Stroke (
	StylusPointCollection stylusPoints
)
public Stroke (
	StylusPointCollection stylusPoints
)
public function Stroke (
	stylusPoints : StylusPointCollection
)
You cannot use constructors in XAML.

Parameters

stylusPoints

A StylusPointCollection that represents the Stroke.

Exception typeCondition

ArgumentNullException

stylusPoints is a null reference (Nothing in Visual Basic).

ArgumentException

stylusPoints is empty..

The following example demonstrates how to create a Stroke from a StylusPointCollection and DrawingAttributes object. This example assumes that there is an InkPresenter called myInkPresenter.

DrawingAttributes drawingAttributes1 = new DrawingAttributes();
drawingAttributes1.Color = Colors.Green;

StylusPoint stylusPoint1 = new StylusPoint(100, 100);
StylusPoint stylusPoint2 = new StylusPoint(100, 200);
StylusPoint stylusPoint3 = new StylusPoint(200, 200);
StylusPoint stylusPoint4 = new StylusPoint(200, 100);
StylusPoint stylusPoint5 = new StylusPoint(100, 100);

StylusPointCollection points = new StylusPointCollection(
    new StylusPoint[] { stylusPoint1, stylusPoint2, stylusPoint3, 
                        stylusPoint4, stylusPoint5 });

Stroke newStroke = new Stroke(points, drawingAttributes1);

myInkPresenter.Strokes.Add(newStroke);

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft