给你一个差不多的例子,你自己再处理一下,应该可以达到效果,代码如下:
'新建一个form1,添加一个按键和一个Picture1,可以看运行效果
'利用Polyline可以画折线,扩散一点可以制作质控的折线图。
'cxy 2009 02 25
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function Polyline Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
Dim Pts(0 To 6) As POINTAPI
Private Sub Command1_Click()
Picture1.Scale (-100, 100)-(100, -100)
'以下为自己增加的曲线的方法:
'x为x(横轴)方向的偏移量
'y为y(纵轴)方向的偏移量(也可以理解为实际的数据值)
Pts(0).X = 170: Pts(0).Y = 10
Pts(1).X = 180: Pts(1).Y = 70
Pts(2).X = 190: Pts(2).Y = 5
Pts(3).X = 200: Pts(3).Y = 100
Pts(4).X = 220: Pts(4).Y = 20
Pts(5).X = 230: Pts(5).Y = 180
Pts(6).X = 240: Pts(6).Y = 40
Polyline Picture1.hdc, Pts(0), 7
End Sub