Rank: Newbie
Groups: Registered
Joined: 11/10/2020(UTC) Posts: 1  Location: Borgomanero
|
Hi everyone, We're developing a WPF app for touchscreen devices using WPF PDF viewer: are touch events directly supported? As far as now we're intercepting manipulation events,like this: Code:void ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
{
int idx = PDFviewer.CurrentIndex;
var mousePoint = e.ManipulationOrigin;
var leftTopPagePoint = PDFviewer.ClientToPage(idx, new Point(0, 0));
var pagePoint = PDFviewer.ClientToPage(idx, mousePoint);
if (e.DeltaManipulation.Scale.X < 1 && PDFviewer.Zoom > 0.4)
PDFviewer.Zoom /= zoomFactor;
else if (e.DeltaManipulation.Scale.X > 1)
PDFviewer.Zoom *= zoomFactor;
PDFviewer.SizeMode = SizeModes.Zoom;
var newPagePoint = PDFviewer.ClientToPage(idx, mousePoint);
var offsetPoint = new Point(newPagePoint.X - pagePoint.X, newPagePoint.Y - pagePoint.Y);
var scrollPoint = new Point(leftTopPagePoint.X - offsetPoint.X, leftTopPagePoint.Y - offsetPoint.Y);
PDFviewer.ScrollToPoint(idx, scrollPoint);
}
It works, but it's basic, we're looking for a better user experience. Also, panning works fine with stylus but not with finger touches. Can anyone point us in the right direction? Thanks in advance!
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close