vb怎么将多个点用光滑曲线连起来,并画出这条曲线的平均线最好加上代码 平均线是穿过曲折直线的一条直线
答案:2 悬赏:70 手机版
解决时间 2021-02-02 11:43
- 提问者网友:了了无期
- 2021-02-01 11:09
vb怎么将多个点用光滑曲线连起来,并画出这条曲线的平均线最好加上代码 平均线是穿过曲折直线的一条直线
最佳答案
- 五星知识达人网友:空山清雨
- 2021-02-01 11:19
用贝塞尔曲线画就可以了Private Type POINTAPIx As Longy As LongEnd TypePrivate Declare Function PolyBezierTo Lib gdi32.dll (ByVal hdc As Long,lppt As POINTAPI,ByVal cCount As Long) As LongPrivate Sub Form_Paint()Dim pts(0 To 6) As POINTAPI'set the coördinatespts(0).x = 22:pts(0).y = 33pts(1).x = 66:pts(1).y = 55pts(2).x = 177:pts(2).y = 88pts(3).x = 199:pts(3).y = 111pts(4).x = 299:pts(4).y = 222pts(5).x = 80:pts(5).y = 333PolyBezierTo Me.hdc,pts(0),6End Sub平均线 是个什么线?求出平均值后话直线吗?那就lineto好了 Private Type POINTAPIx As Longy As LongEnd TypePrivate Declare Function PolyBezierTo Lib gdi32.dll (ByVal hdc As Long,lppt As POINTAPI,ByVal cCount As Long) As LongPrivate Sub Form_Paint()Dim pts(0 To 6) As POINTAPIDim pt(0 To 6) As POINTAPI'set the co?rdinatespts(0).x = 22:pts(0).y = 33pts(1).x = 66:pts(1).y = 55pts(2).x = 177:pts(2).y = 88pts(3).x = 199:pts(3).y = 111pts(4).x = 299:pts(4).y = 222pts(5).x = 80:pts(5).y = 333For n = 1 To 6pt(n).x = (pts(n).x + pts(n - 1).x) / 2pt(n).y = (pts(n).y + pts(n - 1).y) / 2Next nPolyBezierTo Me.hdc,pt(0),6PolyBezierTo Me.hdc,pts(0),6End Sub
全部回答
- 1楼网友:逃夭
- 2021-02-01 11:46
正好我需要
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯