Skip to content

包含了用LineGraph控件的使用案例. 主要包括多线程绘画图形, 多线程动态旋转图形等, 并且用Point封装了划线方法使之更方便使用

Notifications You must be signed in to change notification settings

Eagle104fred/InteractiveDataDisplay.WPF

Repository files navigation

Tips:不要使用NuGet安装InteractiveDataDisplay库, 直接下载微软官方源码, 在Debug目录下的dll是可以在framework4.6.1下正常使用的

微软官方项目:https://github.com/microsoft/InteractiveDataDisplay.WPF

画动态旋转梯形

image

代码:

public void DrawFieldOfViewDynamic(LineGraph line,double center_X=0,double center_Y=0)
        {
           
            
            Task.Run(async () =>
            {
                //KS:构建原初图形 
                List<Point> pointList = new List<Point>();
                pointList.Add(new Point(-4, 6));
                pointList.Add(new Point(4, 6));
                pointList.Add(new Point(1, 1));
                pointList.Add(new Point(-1, 1));
                pointList.Add(new Point(-4, 6));

                for (double i = 0; i < 360; i += 2) //KS:i为精度 
                {
                    Thread.Sleep(100);
                    List<Point> pointListTrans = new List<Point>();
                    for (int j = 0; j < pointList.Count; j++)
                    {
                        Point tempPoint = RotateTransform(pointList[j].X - center_X, pointList[j].Y - center_Y, i);
                        pointListTrans.Add(tempPoint);
                        
                    }

                    //KS:切换两种刷新方法 
                    PenDrawKeepOld(line, pointListTrans);
                    //PenDrawRefresh(line, pointListTrans);
                }



                await Task.Delay(1);
            });
            
        }

About

包含了用LineGraph控件的使用案例. 主要包括多线程绘画图形, 多线程动态旋转图形等, 并且用Point封装了划线方法使之更方便使用

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages