So, I need a way to make a dynamically moving trace graph and have no idea how/where to start. I've been searching the net for quite some time, as well as experimenting on my own with pictureboxes, but, unfortunately, found absolutely nothing of any use.
Can anybody give me an example/control, please?
(Oh, and.. hi ;))
Making a moving line/trace graph
Started by robhol, Mar 04 2009 03:38 AM
13 replies to this topic
#1
Posted 04 March 2009 - 03:38 AM
|
|
|
#2
Posted 04 March 2009 - 08:33 AM
Can you explain a bit more? My first thought would be to render a graph, pause for a bit, then render the next one, but it really depends a lot on what you are trying to accomplish.
#3
Posted 04 March 2009 - 10:53 PM
Here's your side dish of in-depth information. ;)
I'm trying to make an ECG simulator (you know, heart monitor thingie)
So, what I'd ideally want to do is have a line graph with a "sweep" that moves "ahead" of the current drawing point, erasing the previous portion of the trace, then drawing the new data once the sweep has passed.
Something like this:
robhol.net/etc/SR.gif
(Dumb forum won't let me post links or pics... -.-')
I'm trying to make an ECG simulator (you know, heart monitor thingie)
So, what I'd ideally want to do is have a line graph with a "sweep" that moves "ahead" of the current drawing point, erasing the previous portion of the trace, then drawing the new data once the sweep has passed.
Something like this:
robhol.net/etc/SR.gif
(Dumb forum won't let me post links or pics... -.-')
#4
Posted 05 March 2009 - 08:52 AM
All you really need to do is draw a black point and a horizontal white line a certain distance ahead of it. Have the x-coordinate of the white line be calculated with a modulus (%) so that it wraps properly.
#5
Posted 05 March 2009 - 12:03 PM
Any sort of graphics you need to draw onto forms can be accomplished in .NET with the System.Drawing namespace. Here, the DrawLine() and perhaps DrawRectangle() may come in handy. Check the documentation (or the IntelliSense) to see its parameters.
#6
Posted 05 March 2009 - 10:34 PM
I've tried that and can't get it working. The different bugs that happen are too many to mention or, for that matter, remember.
Any chance someone could whip together a quick example for me?
Any chance someone could whip together a quick example for me?
#7
Posted 06 March 2009 - 08:48 AM
Start by posting your code. It may be something simple.
#8
Posted 06 March 2009 - 09:37 AM
I haven't got any, at the moment. After the first 500000000000 tries or so I realized I might have missed something basic, which is why I'm asking for an example or some very detailed instructions now. ;P
#9
Posted 06 March 2009 - 11:50 AM
Perhaps the issue you were having was that refreshing the form (for example, obscuring it with another window and then viewing it again) wil cause the custom drawings to be lost. To avoid this, save the lines to a bitmap object, and then draw the bitmap to the form every time the form isredrawn (with the form's Paint function).
#10
Posted 06 March 2009 - 01:34 PM
Bitmaps don't natively support drawing lines, or for that matter, anything else except one-at-a-time pixel editing, and I'm not sure how to do it.
#12
Posted 07 March 2009 - 02:13 PM
Yeah yeah... thing is, I don't know jack: can anybody please make me an example?


Sign In
Create Account


Back to top









