Visual Basic Development Bookmark and Share   
 Home > Visual Basic Language > drawing 2D color coded graph in vb 2005
 

drawing 2D color coded graph in vb 2005

HI all
i am a beginnerto vb prograping. so can anybody help me to draw a diagram like below in vb 2005


After capturing each data point, software creates a BER eye plot with x/y offset of 3 ps/20 mV and 562 data bits.

After capturing each data point, software creates a BER eye plot with x/y offset of 3 ps/20 mV and 562 data bits.
saumya_kuanr  Friday, November 27, 2009 7:53 AM
Different shapes can be created by using a GraphicsPath and filling it with a color . You would create the GraghicsPath and then add lines , arcs , curves , Ellipses etc to it then when you draw on a graphics surface such as in the paint event of a form or control you would use the FillPath method to fill the graphics path with a color .
coding for fun Be a good forum member mark posts that contain the answers to your questions or those that are helpful
Please format the code in your posts with the button . Makes it easier to read .
bdbodger  Friday, November 27, 2009 10:12 PM
I have the code for this somewhere and will post it if I can find it, but the process is this.

Triangulate the 2D space. If the coordinates are regular, then this simply involves drawing each horizontal andeach vertical, and thenone diagonal for each point. This would be a notional triangulation, of course. The simplest approach is to create a triangle class and use a List(Of triangle objects. Your triangle class consists of three points each of whichhas an (X,Y) position and a value - the reading at that coordinate.

Then, for each countour line, process each triangle in the space. Sequence doesn't matter. The points of the trianglewill have values that are eitherall three above the contour value or all three below the contour value,or two sides of the triangle will cross the contour value (one end of a side above, other end below, for two of the three sides).These are the only three possibilities, providedyou fudge things slightly so that an exact match between the value at apoint of a triangle and the contour valueis treated as a small arbitrary mismatch (but be consistent in your arbitrariness).If the triangleis entirely above or entirely below the contour value, ignore it. For the remaining triangles, work out the proportionate distance along each of the two sides where the contour value crosses the side. Draw a line between these two points (there will always be two). This is a real line, not a notional one.

FloodFill the regions between the lines with colors representing the contour values.


Acamar  Saturday, November 28, 2009 10:34 AM

You can use google to search for other answers

Custom Search

More Threads

• Create RecordSet from VB6 editor to VS2005 Application Dataset
• print gridview
• reading byte array in meaningful way ?
• How to set location to a word application?
• Database
• Selecting a row on a Datagrid in VB 2005 Express
• msgbox when a tabpage is selected
• Newbie....Closing multiple forms
• SQL question
• Console Output