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
)

Parameters

x
Type: System.Double

The x-coordinate of the StylusPoint.

y
Type: System.Double

The y-coordinate of the StylusPoint.

pressureFactor
Type: System.Single

The amount of pressure applied to the StylusPoint.

stylusPointDescription
Type: System.Windows.Input.StylusPointDescription

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

additionalValues
Type: System.Int32[]

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

Exception Condition
ArgumentOutOfRangeException

pressureFactor is less than 0 or greater than 1.

-or-

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

ArgumentException

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
Show: