I'd go for
System.Drawing.Graphics.DrawLines()[
^] to draw multiple lines sequentially. You would take the individual corner points' co-ordinates from your array.
Depending on what exactly that array contains, you may have to
Transform[
^] the Graphics object.
I would use a panel-derived custom class to do the drawing. Place the drawing code within an overridden OnPaint() method. Make sure that at any given time, the painting code will work because Windows will call the drawing code whenever it feels so.
public class MyClass : System.Windows.Forms.Panel
{
private Pen _pen = Pens.Black;
private PointF[] _points = null;
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if( _points != null)
{
e.Graphics.DrawLines(_pen, _points);
}
}
public PointF[] Points
{
get{ return(_points); }
set
{
_points = value;
this.Invalidate();
}
}
The assignment to
Transform
is commented out because it is (for me) highly experimental. You can use it to invert the y-axis (I hope). So larger y values should move a point up on your screen. Without it, y will start at 0 at the top of your panel. It will also scale your values so both axis range from [-2 ; 2] instead of 0 to number_of_pixels_wide or number_of_pixels_high respectively.