Android 心电图
我想制作一个实时显示有氧图的应用程序。这意味着我想测量心率并希望在我的应用程序中以图表形式显示比特率。但我想画有氧图。我已经浏览了许多示例图形代码,但没有得到任何绘制有氧图的线索。有没有任何机构提供任何线索?
I want to make an app which shows cardio graph in real time. That means i want to measure heart bit and want to show the bit rate in graph in my application. But i wondering to draw the cardio graph. I have gone through many sample graph codes but dint get any clue to draw cardio graph. Is there any clue from any body?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于这个特定的应用程序,您可能需要使用 Path 和 SurfaceView “手动”绘制图形。
在初始化期间准备好 Paint 实例:
当您需要更新图形时,清除场景并构建线条路径(根据您的需要进行调整):
您也可以使用quadTo或cubicTo代替lineTo。
如果你希望你的图表具有实时动画效果(即向左滑动,而数据从右侧传入),你可以以类似于著名的 LunarLander 示例的方式在 SurfaceView 上绘制(以下代码是简化版本):
其中 mSurfaceHolder 是通过调用
yourSurfaceView.getHolder()
获取的,而doDraw
是在哪里您调用canvas.drawPath() 以及所有绘图代码。
For this specific application, you may want to draw the graph "by hand" using Path and a SurfaceView.
Get a Paint instance ready during initialization:
When you need to update the graphic, clear the scene and build the line path (adapt this to your needs) :
You may also use quadTo or cubicTo instead of lineTo.
If you want your graph to have a realtime animation effect (i.e. sliding to the left while data is coming on the right), you may draw on a SurfaceView in a similar way to the famous LunarLander example (following code is a simplified version):
Where mSurfaceHolder is obtained by calling
yourSurfaceView.getHolder()
anddoDraw
is whereyou call
canvas.drawPath()
and all your drawing code.