StylusPoint Constructor (Double, Double, Single)


Initializes a new instance of the StylusPoint class using specified (x, y) coordinates and pressure.

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

public StylusPoint(
	double x,
	double y,
	float pressureFactor


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.

Exception Condition

pressureFactor is less than 0 or greater than 1.

pressureFactor must have a value between 0 and 1, inclusive. A value of 0 indicates that no pressure is applied, while a value of 1 indicates that the maximum amount of pressure is applied. A value of 0.5 indicates that 50% of the maximum pressure is applied, and so on.

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