This topic has not yet been rated - Rate this topic

StylusPointCollection Constructor (Int32)

Initializes a new instance of the StylusPointCollection class that may initially contain the specified number of StylusPoint objects.

Namespace:  System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)
public StylusPointCollection(
	int initialCapacity
)
You cannot use constructors in XAML.

Parameters

initialCapacity
Type: System.Int32

The number of StylusPoint objects the StylusPointCollection can initially contain.

ExceptionCondition
ArgumentException

initialCapacity is negative.

When you use the StylusPointCollection constructor to create a new StylusPointCollection, you specify it's initialCapacity. However, you can add more StylusPoint objects by calling the Add method.

The following example collects StylusPoint objects in the OnStylusDown method of a custom control. The example creates a StylusPointCollection by specifying both the StylusPointDescription and the initial size of the StylusPointCollection.

StylusPointCollection stylusPoints;

protected override void OnStylusDown(StylusDownEventArgs e)
{
    base.OnStylusDown(e);

    StylusPointCollection eventPoints = e.GetStylusPoints(this);

    // Create a new StylusPointCollection using the StylusPointDescription 
    // from the stylus points in the StylusDownEventArgs.
    stylusPoints = new StylusPointCollection(eventPoints.Description, eventPoints.Count);
    stylusPoints.Add(eventPoints);

}

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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.

.NET Framework

Supported in: 3.5, 3.0
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.