【发布时间】:2018-05-05 01:35:31
【问题描述】:
我在向 WPF C# 应用程序添加捏缩放功能时遇到问题。
我已经有了一个很好用的鼠标滚轮缩放,我想用它作为起点。
这是我的代码,如您所见,获取光标位置和增量不起作用。
private void pdfViewer_touchZoom(object sender, TouchEventArgs e)
{
e.Handled = true;
int idx = pdfViewer.CurrentIndex;
//Get cursor position (this isn't working)
var mousePoint = e.GetPosition(this.pdfViewer);
[...]
//Delta not working (mouse wheel negative value)
if (e.Delta < 0 && pdfViewer.Zoom > 0.4) /
zoomMinus();
else if
[...]
}
【问题讨论】:
-
有什么问题?对于触摸设备,您必须识别手势,请参阅msdn(感谢this answer)。
-
谢谢,我会在白天检查一下,然后,我会回复你。