Help with making a PC oscilloscope , graphing display how??

Hi I have built a simple A/D converter that connects to the PC's lpt port and i have stored the values in a array,
i want to display these values as a oscilloscope type display, anyone point me at a bit of sample code for generating such a display?
many thanks

2E0AQUAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
There is a sample here, using Managed DirectX to plot a sine wave:

http://www.drunkenhyena.com/cgi-bin/view_net_article.pl?chapter=2;article=20

Down toward the bottom are links for the code:

Source for VB.Net (9K)
To compile this lesson you will also need the Drunken Hyena .Net Common Code

You are also going to need the DirectX 9 SDK:

Microsoft DirectX Downloads
http://msdn.microsoft.com/directx/sdk/

The process of using DirectX is very powerful, but also very complex, and the learning curve is very daunting, but with power comes speed and versatility.

Bob
jrschererCEOCommented:
Why not using the pretty strong GDI+?
Here is an example.

To run it you need to add Imports System.Math to the top of the form class.
Then create a PictureBox with the default name PictureBox1 abour 4 x 4 inches in size. Give it a green background color. (I use BackColor = Color.SeaGreen. It looks like my Tek 465!)

Add the following code to your form and run it.

    Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
        Dim ix As Integer = PictureBox1.Width
        Dim iy As Integer = PictureBox1.Height

        ' Make up some values
        Dim Values(ix) As Double
        For i As Integer = 0 To Values.GetUpperBound(0)
            Values(i) = Sin(i * 25)
        Next

        ' Display the values
        Dim OldPoint = New Point(0, iy \ 2)
        For i As Integer = 1 To Values.GetUpperBound(0)
            Dim y As Integer = iy \ 2 + CInt(Values(i) * (iy \ 3)) ' do some scale factor to make it look good
            Dim NewPoint = New Point(i, y)
            e.Graphics.DrawLine(Pens.Yellow, OldPoint, NewPoint)
            OldPoint = NewPoint
        Next

        ' Make the Grid
        For x As Integer = 25 To ix Step 25
            e.Graphics.DrawLine(Pens.LightGreen, x, 0, x, iy)
        Next
        For y As Integer = iy - 25 To 0 Step -25
            e.Graphics.DrawLine(Pens.LightGreen, 0, y, ix, y)
        Next
    End Sub

have fun   Jack.net

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
2E0AQUAuthor Commented:
Thanks to both of you for the help, i have split the points as although im not using TheLearnedOnes answer it will give me  some pointers for more complex stuff when im ready.
Thanks to both of you.
Regards
Paul
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.