Share via


InkStrokeInput 类

定义

为与 InkPresenter 对象关联的 StrokeInput 提供属性和事件。

public ref class InkStrokeInput sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class InkStrokeInput final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class InkStrokeInput
Public NotInheritable Class InkStrokeInput
继承
Object Platform::Object IInspectable InkStrokeInput
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

示例

在这里,我们声明一个 StrokeStarted 侦听器。

inkCanvas.InkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted;

然后,我们定义相应的处理程序,该处理程序在启动新的墨迹笔划时清除任何选定的笔划。

private void StrokeInput_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
{
  var strokes = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();
  foreach (var stroke in strokes)
  {
    stroke.Selected = false;
  }
  ClearDrawnBoundingRect();
}

属性

InkPresenter

获取与墨迹输入数据关联的 InkPresenter 对象。

事件

StrokeCanceled

当墨迹输入冒泡到另一个系统事件处理程序(如上下文菜单)时发生。

StrokeContinued

StrokeStarted) (笔划输入开始并继续由 InkPresenter 对象捕获时发生。

StrokeEnded

InkPresenter 对象停止检测到笔划输入时发生。

StrokeStarted

InkPresenter 对象首次检测到笔划输入时发生。

适用于

另请参阅