Esta documentación está archivada y no tiene mantenimiento.

StylusPointCollection (Constructor) (Int32)

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

Espacio de nombres: System.Windows.Input
Ensamblado: PresentationCore (en presentationcore.dll)

public StylusPointCollection (
	int initialCapacity
)
public StylusPointCollection (
	int initialCapacity
)
public function StylusPointCollection (
	initialCapacity : int
)
No se pueden utilizar constructores en XAML.

Parámetros

initialCapacity

The number of StylusPoint objects the StylusPointCollection can initially contain.

Tipo de excepciónCondición

ArgumentException

initialCapacity is negative.

When you use the StylusPointCollection constructor to create a new StylusPointCollection, the StylusPointCollection is created with the capacity to hold the specified number of StylusPoint objects. You can add more StylusPoint objects that initialCapacity by calling the Add method.

The following example collects StylusPoint objects in the OnStylusDown method of a custom control. A StylusPointCollection is created by specifying 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);

}

Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.

.NET Framework

Compatible con: 3.0
Mostrar: