wpf提供了5個(gè)關(guān)于觸摸的函數(shù):touch打頭,以下暫時(shí)實(shí)現(xiàn)功能,不做優(yōu)化
1、滑動(dòng)觸發(fā)滾動(dòng)條

image.png

image.png
[圖片上傳中...(image.png-ae237a-1629452839191-0)]
2、手勢(shì)縮放操作

image.png
List<Point> pointList = new List<Point>();
private void MoonPdfPanel_MouseLeftButtonDown(object sender, TouchEventArgs e)
{
e.GetTouchPoint(this);
pointList.Add(e.GetTouchPoint(this).Position);
}
private void MoonPdfPanel_MouseLeftButtonUp(object sender, TouchEventArgs e)
{
if(pointList.Count == 2)//只判斷兩個(gè)手指的操作
{
Point pp = e.GetTouchPoint(this).Position;
if(pp.Y > pointList[0].Y&&pp.Y>pointList[1].Y || pp.Y < pointList[0].Y && pp.Y < pointList[1].Y)//放大
{
}
else//縮小
{
}
pointList.Clear();
}