public override void Draw (DrawContext context) { RectangleF r = Bounds, l1 = new RectangleF(), l2 = new RectangleF(); float spacing = .15F; float width = .2F; if (r.Width==0) { l1 = new RectangleF(r.X,r.Y,0,spacing); l2 = new RectangleF(r.X,r.Bottom-spacing,0,spacing); r.Height -= spacing*2; r.Y += spacing; r.Width = width; r.X -= width/2; } else { r.Width = spacing*2; r.X += spacing; r.Height = width; r.Y -= width/2; } r = context.TransformF(r); l1 = context.TransformF(l1); l2 = context.TransformF(l2); context.graphics.DrawRectangle(context.WallPen,r.Left,r.Top,r.Width,r.Height); context.graphics.DrawLine(context.WallPen,l1.Left,l1.Top,l1.Right,l1.Bottom); context.graphics.DrawLine(context.WallPen,l2.Left,l2.Top,l2.Right,l2.Bottom); }
public virtual void Draw (DrawContext context) { RectangleF r = context.Transform(_location.Bounds); float spacing = .25F*r.Width; context.graphics.FillEllipse(System.Drawing.Brushes.Blue,r.X+spacing,r.Y+spacing,r.Width-spacing*2,r.Height-spacing*2); spacing = .38F*r.Width; context.graphics.FillEllipse(System.Drawing.Brushes.LightBlue,r.X+spacing,r.Y+spacing,r.Width-spacing*2,r.Height-spacing*2); }
public MazeView (MazeGame game, MainForm form) { _context = new DrawContext(null); _game = game; _game.View = this; _form = form; _control = _form.pnlMazeView; }
public override void Draw (DrawContext context) { RectangleF r = context.TransformF(Bounds); context.graphics.DrawLine(context.WallPen,r.Left,r.Top,r.Right,r.Bottom); }
public override void Draw (DrawContext context) { if (!context.ClipRect.IntersectsWith(GetDrawingBounds(context))) return; DrawContents(context); foreach (Direction d in Direction.Directions) { if (Neighbors[d] == null) { RectangleF r = context.TransformF(GetBorderLine(d)); context.graphics.DrawLine(context.WallPen,r.Left,r.Top,r.Right,r.Bottom); } /* else if (Neighbors[d] is Room) { RectangleF r = context.TransformF(GetBorderLine(d)); context.graphics.DrawLine(context.GridPen,r.Left,r.Top,r.Right,r.Bottom); } */ } }
public new Rectangle GetDrawingBounds (DrawContext context) { return context.Transform(Bounds); }
public void DrawContents (DrawContext context) { RectangleF r = context.TransformF(Bounds); //float spacing = .25F*r.Width; if (this == context.maze.StartRoom) { //context.graphics.FillEllipse(System.Drawing.Brushes.Green,r.X+spacing,r.Y+spacing,r.Width-spacing*2,r.Height-spacing*2); context.graphics.FillRectangle(System.Drawing.Brushes.LightGreen,r); } else if (this == context.maze.FinishRoom) { //context.graphics.FillEllipse(System.Drawing.Brushes.Red,r.X+spacing,r.Y+spacing,r.Width-spacing*2,r.Height-spacing*2); r.Offset(1,1); context.graphics.FillRectangle(System.Drawing.Brushes.LightPink,r); } //context.graphics.DrawString(Bounds.X+","+Bounds.Y, new Font("Verdana",7), System.Drawing.Brushes.Gray, r.X, r.Y); }
public MapSiteAction_Draw (DrawContext context) { _context = context; }
//default implementation does nothing public virtual void Draw (DrawContext context) {}