System.Drawing.Graphics.DrawEllipse C# (CSharp) Method

DrawEllipse() public method

public DrawEllipse ( Pen pen, Rectangle rect ) : void
pen Pen
rect Rectangle
return void
        public void DrawEllipse(Pen pen, Rectangle rect)
        {
            if (pen == null)
                throw new ArgumentNullException ("pen");

            DrawEllipse (pen, new RectangleF (rect.X, rect.Y, rect.Width, rect.Height));
        }

Same methods

Graphics::DrawEllipse ( Pen pen, RectangleF rect ) : void
Graphics::DrawEllipse ( Pen pen, float x, float y, float width, float height ) : void
Graphics::DrawEllipse ( Pen pen, int x1, int y1, int x2, int y2 ) : void

Usage Example

Example #1
0
        /// <summary>
        /// Draw method.
        /// </summary>
        /// <param name="g">Graphics context.</param>
        public override void Draw(Graphics g)
        {
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            g.FillEllipse(LcogBrushes.Planet, this.X, this.Y, 2, 2);

            if (this.Faction == null)
            {
            }
            else if (this.Faction == Client.Instance.Player.Faction)
            {
                g.DrawEllipse(LcogPens.OwnPlanet, this.X - 2, this.Y - 2, 6, 6);
            }
            else if (this.Faction != Client.Instance.Player.Faction && this.Faction.Relations == "neutral")
            {
                g.DrawEllipse(LcogPens.NeutralPlanet, this.X - 2, this.Y - 2, 6, 6);
            }
            else
            {
                g.DrawEllipse(LcogPens.HostilePlanet, this.X - 2, this.Y - 2, 6, 6);
            }

            if (this == Client.Instance.Selected)
            {
                g.DrawEllipse(LcogPens.Selected, this.X - 2, this.Y - 2, 6, 6);
            }
        }
All Usage Examples Of System.Drawing.Graphics::DrawEllipse