C#-实时绘制数据 [英] C# - Realtime Plotting of data
本文介绍了C#-实时绘制数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hii
我正在一个项目中,我要连续绘制来自串行端口的数据[数据超过4小时].我可以画线图.但是我想通过滚动查看从头到尾的情节.请给我一个解决方案.
Hii
I am working on a project in which i want to plot the data coming from serial port continuously [data more than 4 hrs]. I can draw the line graph. But I want to see the plot from start to end by scrolling. Please give me a solution.
推荐答案
我也有类似的要求,我的解决方案是使用graphicspath ...我将点添加到比例为1:1的图形路径中然后在绘制到屏幕上时,我使用矩阵函数缩放要显示的迹线,并使用裁剪区域仅在屏幕上显示我想要的部分.快速有效.
要使用的对象(假设g是当前图形对象)
设置
g.Clip =在屏幕显示区域上作为剪辑区域:
GraphicsPath gx = new GraphicsPath();
添加线,路径,矩形等...
gx.Transform(缩放和滚动图形)
g.DrawPath(实际上绘制轨迹)
Derek
I had a similar requirement, my solution was to use graphicspath ... I add the points to a graphics path scaled 1:1 then when drawing to the screen I use the matrix functions to scale the traces for display and the clip region to only show the part I want on screen. Works a treat and really fast.
Objects to use ( assumes g is the current graphics object)
Set
g.Clip = on screen display area as a clip region:
GraphicsPath gx = new GraphicsPath();
Add line, paths, rectangles etc ......
gx.Transform( to scale and scroll graph)
g.DrawPath( actually draw traces )
Derek
我的工作类似,但是数据来自以太网.
相信ZedGraph可以帮助您,看看:
http://codeabout.wordpress.com /2012/02/10/plotting-graphs-in-c-with-zedgraph-and-vs-2010/ [
I have something similar at work, but with data coming from ethernet.
I believe ZedGraph can help you, take a look:
http://codeabout.wordpress.com/2012/02/10/plotting-graphs-in-c-with-zedgraph-and-vs-2010/[^]
这篇关于C#-实时绘制数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文