Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/Canvas.cs @ 1122

Last change on this file since 1122 was 1038, checked in by mstoeger, 16 years ago

Modified the XAxis labels so they are always visible at the bottom. (#433)
Added simple layout management to the line chart's root shape containing a title-, lines- and xaxis-area. (#345)

File size: 730 bytes
Line 
1using System.Diagnostics;
2using System.Drawing;
3using System.Drawing.Drawing2D;
4
5namespace HeuristicLab.Visualization {
6  public class Canvas : ICanvas {
7    private WorldShape world;
8
9    public WorldShape WorldShape {
10      get { return world; }
11      set { world = value; }
12    }
13
14
15    public void Draw(Graphics graphics, Rectangle viewport) {
16      Stopwatch sw = new Stopwatch();
17      sw.Start();
18
19      GraphicsState gstate = graphics.Save();
20
21      graphics.SetClip(viewport);
22
23      world.Draw(graphics, viewport, world.BoundingBox);
24
25      graphics.Restore(gstate);
26
27      sw.Stop();
28      Trace.WriteLine(string.Format("Drawing time: {0:0.0}ms", sw.Elapsed.TotalMilliseconds));
29    }
30  }
31}
Note: See TracBrowser for help on using the repository browser.