Ive created a very simple yet effective graph with VB6 that Id like to use in my PB apps, but graphics in PBDLL seem to be so different than in VB6 so I'm getting nowhere
My graph is very easy to build, just start a new VB project and add just two controls - one picturebox (Autoredraw=True, Forecolor=Green, ScaleMode=Pixels, ScaleWidth=110, ScaleWidth=80), and a Timer.
Add this code to the project, and press F5 to start. It will show randomly created values, I think it looks kinda neat considering there's not much behind it
I want to do this with pure PB code only, no 3rd party DLLs
------------------
My graph is very easy to build, just start a new VB project and add just two controls - one picturebox (Autoredraw=True, Forecolor=Green, ScaleMode=Pixels, ScaleWidth=110, ScaleWidth=80), and a Timer.
Add this code to the project, and press F5 to start. It will show randomly created values, I think it looks kinda neat considering there's not much behind it
Code:
Dim GraphValue(100) As Integer 'Can display up to 100 different values Private Sub Form_Load() On Error Resume Next For I = 1 To 100 GraphValue(I) = 0 Next I Timer1.Interval = 200 End Sub Private Sub Timer1_Timer() Dim NextVal As Integer Picture1.Cls 'Move all values down 1 (visually all pixels move left 1) For I = 2 To 100 GraphValue(I - 1) = GraphValue(I) Next I Randomize GraphValue(100) = CInt(Rnd * 70) 'Picture1 is only 70 pixels high For I = 2 To 100 Picture1.Line (I - 1, 70 - GraphValue(I - 1))-(I, 70 - GraphValue(I)) Next I End Sub
------------------
Comment