StylusPoint 建構函式

定義

初始化 StylusPoint 類別的新執行個體。

多載

名稱 Description
StylusPoint(Double, Double)

使用指定的 (x, y) 座標初始化該 StylusPoint 類別的新實例。

StylusPoint(Double, Double, Single)

使用指定的 (x, y) 座標與壓力初始化該類別的新實例 StylusPoint

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

使用指定的 (x, y) 座標、a StylusPoint、 及在 中pressureFactor指定的額外參數初始化類別的新StylusPointDescription實例。

StylusPoint(Double, Double)

使用指定的 (x, y) 座標初始化該 StylusPoint 類別的新實例。

public:
 StylusPoint(double x, double y);
public StylusPoint(double x, double y);
new System.Windows.Input.StylusPoint : double * double -> System.Windows.Input.StylusPoint
Public Sub New (x As Double, y As Double)

參數

x
Double

的 x 座標 StylusPoint

y
Double

的 y 座標 StylusPoint

範例

以下範例示範如何建立 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);
Dim newDescription As 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)})

Dim propertyValues As Integer() = {1800, 1000, 1}

Dim newStylusPoint As New StylusPoint(100, 100, 0.5F, newDescription, propertyValues)

適用於

StylusPoint(Double, Double, Single)

使用指定的 (x, y) 座標與壓力初始化該類別的新實例 StylusPoint

public:
 StylusPoint(double x, double y, float pressureFactor);
public StylusPoint(double x, double y, float pressureFactor);
new System.Windows.Input.StylusPoint : double * double * single -> System.Windows.Input.StylusPoint
Public Sub New (x As Double, y As Double, pressureFactor As Single)

參數

x
Double

的 x 座標 StylusPoint

y
Double

的 y 座標 StylusPoint

pressureFactor
Single

施加在 StylusPoint. 上的壓力大小。

例外狀況

pressureFactor 小於 0 或大於 1。

範例

以下範例示範如何建立 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);
Dim newDescription As 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)})

Dim propertyValues As Integer() = {1800, 1000, 1}

Dim newStylusPoint As New StylusPoint(100, 100, 0.5F, newDescription, propertyValues)

備註

pressureFactor 必須有介於 0 到 1 之間的值,包含。 0 表示未施加壓力,1 表示施加最大壓力。 0.5 表示施加了 50% 的最大壓力,依此類推。

適用於

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

使用指定的 (x, y) 座標、a StylusPoint、 及在 中pressureFactor指定的額外參數初始化類別的新StylusPointDescription實例。

public:
 StylusPoint(double x, double y, float pressureFactor, System::Windows::Input::StylusPointDescription ^ stylusPointDescription, cli::array <int> ^ additionalValues);
public StylusPoint(double x, double y, float pressureFactor, System.Windows.Input.StylusPointDescription stylusPointDescription, int[] additionalValues);
new System.Windows.Input.StylusPoint : double * double * single * System.Windows.Input.StylusPointDescription * int[] -> System.Windows.Input.StylusPoint
Public Sub New (x As Double, y As Double, pressureFactor As Single, stylusPointDescription As StylusPointDescription, additionalValues As Integer())

參數

x
Double

的 x 座標 StylusPoint

y
Double

的 y 座標 StylusPoint

pressureFactor
Single

施加在 StylusPoint. 上的壓力大小。

stylusPointDescription
StylusPointDescription

A StylusPointDescription 指定儲存在 中的 StylusPoint額外屬性。

additionalValues
Int32[]

一個包含 32 位元有號整數的陣列,包含 中 stylusPointDescription定義的屬性值。

例外狀況

pressureFactor 小於 0 或大於 1。

-或-

裡面對應按鈕屬性的值 additionalValues 不是 0 或 1。

其中的 additionalValues 數值數量與負 stylusPointDescription 3的性質數量不相符。

範例

以下範例示範如何建立 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);
Dim newDescription As 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)})

Dim propertyValues As Integer() = {1800, 1000, 1}

Dim newStylusPoint As New StylusPoint(100, 100, 0.5F, newDescription, propertyValues)

適用於