Changeset 982
- Timestamp:
- 12/12/08 17:55:03 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization.Test/LegendForm.cs
r872 r982 16 16 LegendShape ls = new LegendShape(0, 0, 100, 100, 0, Color.White); 17 17 ls.AddLegendItem(new LegendItem("test", Color.Black)); 18 ls.AddLegendItem(new LegendItem("test2", Color.Red)); 18 19 19 20 mainShape.AddShape(ls); -
trunk/sources/HeuristicLab.Visualization/LegendShape.cs
r873 r982 35 35 36 36 public void Draw(Graphics graphics, Rectangle viewport, RectangleD clippingArea) { 37 using (var pen = new Pen(color, 1)) 38 using (Brush brush = new SolidBrush(color)) { 39 Rectangle screenRect = Transform.ToScreen(rect, viewport, clippingArea); 40 41 graphics.DrawRectangle(pen, screenRect); 42 graphics.FillRectangle(brush, screenRect); 37 int startY = 10; 38 foreach (LegendItem i in legendItems) { 39 using (Pen pen = new Pen(i.Color, 5)) { 40 graphics.DrawLine(pen, 10, startY+10, 30, startY+10); 41 } 42 using (Brush brush = new SolidBrush(Color.Black)) { 43 graphics.DrawString(i.Label, new Font("Arial", 12), brush, 35, startY); 44 } 45 startY += 15; 43 46 } 44 47 }
Note: See TracChangeset
for help on using the changeset viewer.