wpf win10系统 触摸 缩放功能

wpf提供了5个关于触摸的函数:touch打头,以下暂时实现功能,不做优化
1、滑动触发滚动条


image.png
image.png

[图片上传中...(image.png-ae237a-1629452839191-0)]

2、手势缩放操作


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)//只判断两个手指的操作
            {
                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();
            }
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容