示例#1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            Graphics g = e.Graphics;

            //Enable anti-aliasing for prettier vertices!
            g.SmoothingMode   = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;

            g.FillRectangle(gb, new Rectangle(0, 0, this.Width, this.Height));

            foreach (GUIVertex gv in verts)
            {
                gv.Draw(g);
            }

            foreach (GUIEdge edge in edges)
            {
                edge.Draw(g);
            }

            if (CurrentTool != null)
            {
                CurrentTool.Draw(g);
            }
        }
        /// <summary>
        ///     Draws this object to the <see cref="IGraphics" /> provided.
        /// </summary>
        /// <param name="graphics">The graphics object to use to draw this object.</param>
        public override void Draw(IGraphics graphics)
        {
            if (_resourceManager == null)
            {
                throw new ObjectDisposedException(nameof(ShapeController));
            }

            graphics.ResourceManager = _resourceManager;

            Tiling.DrawTiling(_tiles, graphics, StyleManager.LineStyle);

            CurrentTool?.Draw(graphics);
        }