2012-09-18 42 views
1

是否可以在VB6.0中绘制心电图?由于我对VB不是很熟悉,任何类型的帮助将不胜感激。请提前帮助我。在VB6.0中绘制心电图

+0

如果这个问题只是“在VB6.0中绘制”不是更好吗? –

回答

3

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

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

您可以使用图片框的.Line方法来清空当前X点后面的区域和.PSet方法以绘制新点。

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 

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