墨迹画布操作事件
InkCanvas manipulation event
当 InkPresenter 的唯一 InputDeviceType 是 CoreInputDeviceTypes::P en 时,InkCanvas 会发出 ManipulationDelta 事件。当我将输入设备类型更改为更多类型时,则不会。为什么?
InkCanvas->InkPresenter->InputDeviceTypes = CoreInputDeviceTypes::Mouse | CoreInputDeviceTypes::Touch | CoreInputDeviceTypes::Pen;
InkCanvas->ManipulationMode = ManipulationModes::Scale | ManipulationModes::TranslateX | ManipulationModes::TranslateY;
InkCanvas->ManipulationDelta += ref new ManipulationDeltaEventHandler(this, &ClassName::OnManipulationDeltaEvent); // OnManipulationDeltaEvent does not get called
基于 InkCanvas 的备注部分,它提到:
墨迹演示器的配置确定指针事件 处理 InkCanvas 的行为。您必须设置 InkPresenter.InputDeviceTypes to CoreInputDeviceTypes.None for the InkCanvas 处理指针事件,否则它们将传递给 墨迹演示器对象。
因此,如果将"输入设备类型"设置为"笔",则在使用鼠标进行描边时,InkCanvas 可以处理指针事件。但是,如果将 InputDeviceType 设置为"鼠标"并使用鼠标进行描边,则 InkCanvas 无法处理指针事件,它将被传递给 InkPresenter 对象。如果要捕获鼠标移动的事件,可以订阅 StrokeContinuing 事件。
.h:
void MyStrokeContinued(Windows::UI::Input::Inking::InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ e);
。.cpp:
MainPage::MainPage()
{
InitializeComponent();
InkCanvas->InkPresenter->InputDeviceTypes = CoreInputDeviceTypes::Mouse| CoreInputDeviceTypes::Pen;
InkCanvas->InkPresenter->StrokeInput->StrokeContinued += ref new Windows::Foundation::TypedEventHandler< InkStrokeInput^, Windows::UI::Core::PointerEventArgs^>(this, &MainPage::MyStrokeContinued);
}
void MainPage::MyStrokeContinued(InkStrokeInput^ sender, Windows::UI::Core::PointerEventArgs^ e) {
//do somthing
}
相关文章:
- 为什么在popback()操作之后,它仍然打印完整的矢量
- 重载操作程序时出错>>用于类中的字符串 memebr
- Android NDK传感器向事件队列报告奇怪的间隔
- 从文本文件中读取时钟时间和事件时间并进行处理
- 对字符串进行位操作
- WMI检测进程创建事件-c++
- EvtExportLogneneneba API正在将远程计算机的事件日志保存到远程PC本身.如何将其保存到主机
- 我可以在 C++ 中的函数体之外进行操作吗?
- MPI突然停止了对多个核心的操作
- 如何在信号处理程序和普通函数中对全局变量进行互斥读写操作
- 对字符数组中的元素执行逐位操作
- 如何在directx/c++中进行平移/缩放操作
- 墨迹画布操作事件
- Boost状态机语言-"操作"中的"发布"事件
- 狂想曲C++状态图 - 事件(似乎有效)与触发操作(似乎什么都不做)
- 变量更改事件的值,当不对它们进行操作时
- 将事件/操作连接到 QPlainTextEdit
- 为什么boost::互斥使用原子操作和事件,而不是关键部分
- 如何在其他类的嵌套循环中获得主事件循环QCoreApplication,以实现网络操作
- 用c++ (ATL, MFC或纯c++)处理COM事件,实现Java互操作