Changeset 1606
- Timestamp:
- 04/18/09 13:41:01 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/3.2/Canvas.cs
r1530 r1606 50 50 51 51 public void Draw(Graphics graphics) { 52 Stopwatch sw = new Stopwatch(); 53 sw.Start(); 52 try { 53 Stopwatch sw = new Stopwatch(); 54 sw.Start(); 54 55 55 graphics.SmoothingMode = SmoothingMode.AntiAlias;56 graphics.FillRectangle(Brushes.White, Viewport);56 graphics.SmoothingMode = SmoothingMode.AntiAlias; 57 graphics.FillRectangle(Brushes.White, Viewport); 57 58 58 worldShape.Draw(graphics);59 worldShape.Draw(graphics); 59 60 60 graphics.DrawRectangle(Pens.Black, 0, 0, Viewport.Width - 1, Viewport.Height - 1);61 graphics.DrawRectangle(Pens.Black, 0, 0, Viewport.Width - 1, Viewport.Height - 1); 61 62 62 sw.Stop(); 63 Trace.WriteLine(string.Format("Drawing time: {0:0.0}ms", sw.Elapsed.TotalMilliseconds)); 63 sw.Stop(); 64 Trace.WriteLine(string.Format("Drawing time: {0:0.0}ms", sw.Elapsed.TotalMilliseconds)); 65 } catch (OverflowException e) { 66 Trace.WriteLine(e); 67 68 graphics.FillRectangle(Brushes.White, graphics.ClipBounds); 69 70 using (Font font = new Font("Arial", 14)) { 71 const string message = "Zoom level is too high!"; 72 graphics.DrawString(message, font, Brushes.Red, graphics.ClipBounds.X + 10, graphics.ClipBounds.Y + 10); 73 } 74 } 64 75 } 65 76 }
Note: See TracChangeset
for help on using the changeset viewer.