StylusPoint Constructor (Double, Double, Single, StylusPointDescription, Int32[])


Initializes a new instance of the StylusPoint class using specified (x, y) coordinates, a pressureFactor, and additional parameters specified in the StylusPointDescription.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public StylusPoint(
	double x,
	double y,
	float pressureFactor,
	StylusPointDescription stylusPointDescription,
	int[] additionalValues


Type: System.Double

The x-coordinate of the StylusPoint.

Type: System.Double

The y-coordinate of the StylusPoint.

Type: System.Single

The amount of pressure applied to the StylusPoint.

Type: System.Windows.Input.StylusPointDescription

A StylusPointDescription that specifies the additional properties stored in the StylusPoint.

Type: System.Int32[]

An array of 32-bit signed integers that contains the values of the properties defined in stylusPointDescription.

Exception Condition

pressureFactor is less than 0 or greater than 1.


The values in additionalValues that correspond to button properties are not 0 or 1.


The number of values in additionalValues does not match the number of properties in stylusPointDescription minus 3.

The following example demonstrates how to create a StylusPoint.

StylusPointDescription newDescription =
      new StylusPointDescription(new StylusPointPropertyInfo[]
                        new StylusPointPropertyInfo(StylusPointProperties.X),
                        new StylusPointPropertyInfo(StylusPointProperties.Y),
                        new StylusPointPropertyInfo(StylusPointProperties.NormalPressure),
                        new StylusPointPropertyInfo(StylusPointProperties.XTiltOrientation),
                        new StylusPointPropertyInfo(StylusPointProperties.YTiltOrientation),
                        new StylusPointPropertyInfo(StylusPointProperties.BarrelButton)

int[] propertyValues = { 1800, 1000, 1 };

StylusPoint newStylusPoint = new StylusPoint(100, 100, .5f, newDescription, propertyValues);

.NET Framework
Available since 3.0
Return to top