StylusPoint.Explicit(StylusPoint to Point) 运算符

定义

将指定的 StylusPoint 强制转换为 Point

public:
 static explicit operator System::Windows::Point(System::Windows::Input::StylusPoint stylusPoint);
public static explicit operator System.Windows.Point (System.Windows.Input.StylusPoint stylusPoint);
static member op_Explicit : System.Windows.Input.StylusPoint -> System.Windows.Point
Public Shared Narrowing Operator CType (stylusPoint As StylusPoint) As Point

参数

stylusPoint
StylusPoint

要强制转换为 StylusPointPoint

返回

包含与 stylusPoint 相同的 (x, y) 坐标的 Point

注解

以下示例演示如何将 强制转换为 StylusPointPoint 对象,以在每次笔划的开头绘制一个圆。 此示例假定有一 InkCanvas 个名为 inkcanvas1 的对象,并且该 StylusDown 事件已连接到示例中的事件处理程序。

       :::code language="csharp" source="~/snippets/csharp/System.Windows.Input/StylusDevice/GetStylusPoints/Window1.xaml.cs" id="Snippet13":::
       :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/PacketSpy/VisualBasic/Window1.xaml.vb" id="Snippet13":::

适用于