首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在VB6.0中绘制心电图

在VB6.0中绘制心电图
EN

Stack Overflow用户
提问于 2012-09-18 22:28:12
回答 1查看 942关注 0票数 1

在VB6.0中是否可以绘制心电?由于我不太熟悉VB,所以任何类型的帮助都会提前帮助我( help me appreciated.Please .thanks )。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-19 00:01:37

执行此操作的最简单方法是使用AutoRedraw属性设置为true且ScaleMode设置为vbPixels的图片框。

对于每个点,计算Y值(取决于允许的最小值和最大值)。要使其进行扫描,只需在达到图片框(.ScaleWidth)的宽度时,将您绘制的每个折叠点的X值增加到0即可。

您可以使用图片框的.Line方法消隐当前X点后面的区域,并使用.PSet方法绘制新点。

代码语言:javascript
复制
Dim X As Long
Dim LastValue As Long

Private Sub AddPoint(ByVal Value As Long)
  'Clear the line behind (for 5 pixels forward)
  Picture1.Line (X, 0)-(X + 5, Picture1.ScaleHeight), vbBlack, BF

  'Draw the new point and the line from the previous point
  Picture1.Line (X - 1, LastValue)-(X, Value), vbGreen
  Picture1.PSet (X, Value), vbGreen

  'Update the last value so we can draw the line between them
  LastValue = Value

  'Increment the X value for the next point
  X = X + 1
  If X = Picture1.ScaleWidth Then X = 0
End Sub

一种更好的方法是使用您使用类似方法更新的屏幕外图片,并在需要时仅更新picturebox。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12479055

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档