没有用啥特殊的控件
picturebox上用line画的

解决方案 »

  1.   

    vb速度太慢????
    你用那些控件更慢,  
    至少用LINE更快
      

  2.   

    我有一个,控件原代码及相关例题。不过是美国线的,自己写几笔改成K图,这点小改动你应该自己能作吧?
    QQ 61223798
    或留你的 email
      

  3.   

    用LineTo函数
    比VB的Line快十倍
      

  4.   

    cqhydz(qq) :用VB 写不会慢的,只能是你写的不对,可能原因有几个,你用的是 line 绘制,用APi 要快的多,你在绘制过程中使用了一些消耗时间的操作,如日期,颜色的。都需要用不同的技巧避过去.
      

  5.   

    Delphi的TChart功能也太弱主要是没有经验谁能传授一点在图形方面的技术
      

  6.   

    真麻烦:
    我再发个吧,  你看看吧 
    Private Sub DrawKLine(picBroad As PictureBox, CurJL As Long, ts As Long, maxhigh As Double, minlow As Double)
    '画K线
    Dim DrawColor As Long
    Dim i As Long
    Dim MaxJL As LongpicBroad.Cls
    picBroad.Scale
    If CurJL + ts > UBound(hq) Then
        MaxJL = UBound(hq)
    Else
        MaxJL = CurJL + ts
    End IfpicBroad.Scale (CurJL, maxhigh)-(CurJL + ts + 1, minlow)
    For i = CurJL To MaxJL
        If hq(i).spj > hq(i).kpj Then
            DrawColor = QBColor(12)
        ElseIf hq(i).spj < hq(i).kpj Then
            DrawColor = QBColor(10)
        Else
            DrawColor = QBColor(15)
        End If
        picBroad.Line (i + 0.2, hq(i).kpj)-(i + 0.8, hq(i).spj), DrawColor, BF
        picBroad.Line (i + 0.5, hq(i).zgj)-(i + 0.5, hq(i).zdj), DrawColor
    Next
    End Sub
      

  7.   

    Private Sub DrawVolume(picBroad As PictureBox, CurJL As Long, ts As Long, maxhigh As Double, minlow As Double)   '画成交量
    Dim DrawColor As Long
    Dim i As Long
    Dim MaxJL As LongpicBroad.Cls
    picBroad.Scale
    If CurJL + ts > UBound(hq) Then
        MaxJL = UBound(hq)
    Else
        MaxJL = CurJL + ts
    End IfpicBroad.Scale (CurJL, maxhigh)-(CurJL + ts + 1, minlow)
    For i = CurJL To MaxJL
        If hq(i).spj > hq(i).kpj Then
            DrawColor = QBColor(12)
        ElseIf hq(i).spj < hq(i).kpj Then
            DrawColor = QBColor(10)
        Else
            DrawColor = QBColor(15)
        End If
        picBroad.Line (i + 0.2, hq(i).cjl)-(i + 0.8, minlow), DrawColor, BF
        
    Next
    End Sub
      

  8.   

    Private Sub DrawAvangeKline(picBroad As PictureBox, CurJL As Long, ts As Long, maxhigh As Double, minlow As Double, AvangeTs As Long, DrawColor As Long)  '画K线
    '画均线
    Dim i As Long
    Dim MaxJL As Long
    Dim PointValue() As Double
    Dim j As Long
    Dim StartX As Double, StartY As Double
    picBroad.Scale
    If CurJL + ts > UBound(hq) Then
        MaxJL = UBound(hq)
    Else
        MaxJL = CurJL + ts
    End If
    ReDim PointValue(CurJL To MaxJL)
    picBroad.Scale (CurJL, maxhigh)-(CurJL + ts + 1, minlow)For i = CurJL To MaxJL
        If i >= AvangeTs Then
            PointValue(i) = 0
            For j = i - AvangeTs + 1 To i
                PointValue(i) = PointValue(i) + hq(j).spj
            Next
            PointValue(i) = PointValue(i) / AvangeTs
            If i > CurJL Then
                picBroad.Line (StartX, StartY)-(i + 0.8, PointValue(i)), DrawColor
                StartX = i + 0.8
                StartY = PointValue(i)
            Else
                StartX = i
                StartY = PointValue(i)
            End If
        Else
            PointValue(i) = 0
        End If
    Next
    End Sub
    上面是我的代码,  你自己去改一下吧,  反正是通用模块的
      

  9.   

    为什么呢,如果你只是要实现k线图的功能,用mschart控件应该是很容易的呀。要不就用水晶报表吧。
      

  10.   

    这种东西有啥好偷懒的呀,  不就是用line去一根根的画呀  我上面的代码并没有优化的 mschart怎么也没有自己写的灵活呀
      

  11.   

    mschart数据一多就慢得要命
    _1_(杂牌军营jinesc.6600.org) 我以前的贴子中见过你的这段代码但不简单了
    还是感谢你.
      

  12.   

    mschart数据一多就慢得要命
    _1_(杂牌军营jinesc.6600.org) 我以前的贴子中见过你的这段代码但还是简单了
    还是感谢你.
      

  13.   

    mschart数据一多就慢得要命
    _1_(杂牌军营jinesc.6600.org) 我以前的贴子中见过你的这段代码但还是简单了
    还是感谢你.
      

  14.   

    你还想画啥的?? 
    MACD还是 KDJ 还是干啥!  你到底想要实现啥功能 ???
      

  15.   

    vb用api可以很做到。
    速度不慢的