Пример #1
0
        public void Redraw(List <Drawable> drawables, ViewPort vp)
        {
            var drawingVisuals = new DrawingVisual();

            visualCollection.Clear();

            using (var dc = drawingVisuals.RenderOpen())
            {
                foreach (var drawable in drawables)
                {
                    drawable.Draw(dc, vp);
                }
            }

            visualCollection.Add(drawingVisuals);
        }
Пример #2
0
        public override void Draw(DrawingContext ctx, ViewPort vp)
        {
            _geometry.Clear();
            var path = new PathFigure();

            path.StartPoint = new Point(
                _places[0].Coordinate.X + vp.X1 / vp.Scale,
                _places[0].Coordinate.Y + vp.Y1 / vp.Scale);

            for (var i = 1; i < _places.Count; i++)
            {
                var pt = new Point(
                    _places[i].Coordinate.X + vp.X1 / vp.Scale,
                    _places[i].Coordinate.Y + vp.Y1 / vp.Scale);

                var edge = new LineSegment(pt, true);
                path.Segments.Add(edge);
            }

            _geometry.Figures.Add(path);

            ctx.DrawGeometry(Brushes.Transparent, new Pen(Brushes.Red, 3), _geometry);
        }
Пример #3
0
 public abstract void Draw(DrawingContext ctx, ViewPort vp);
Пример #4
0
        public override void Draw(DrawingContext ctx, ViewPort vp)
        {
            var drawingRegion = new Rect(vp.X1, vp.Y1, _bmp.Width, _bmp.Height);

            ctx.DrawImage(_bmp, drawingRegion);
        }