FillEllipse() public method

public FillEllipse ( Brush brush, RectangleF rect ) : void
brush Brush
rect RectangleF
return void
        public static void RepertoryImage(Graphics drawDestination)
        {
            StringFormat itemStringFormat = new StringFormat();
            RectangleF itemBox = new RectangleF(10, 30, 42, 10);
            RectangleF itemBox2 = new RectangleF(60, 48, 10, 10);
            itemStringFormat.Alignment = StringAlignment.Center;
            itemStringFormat.LineAlignment = StringAlignment.Far;
            drawDestination.DrawLine(Pens.LightGray,10,10,10,70);
            if (mMscStyle == MscStyle.SDL){
                PointF[] capPolygon = new PointF[3];
                capPolygon[0] = new PointF(61, 40);
                capPolygon[1] = new PointF(53, 44);
                capPolygon[2] = new PointF(53, 36);
                drawDestination.FillPolygon(Brushes.Black,capPolygon);
                drawDestination.DrawString("Lost",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
                drawDestination.DrawString("g",new Font("Arial",8),Brushes.Black,itemBox2,itemStringFormat);
                drawDestination.DrawLine(Pens.Black,10, 40, 60,40);
                drawDestination.FillEllipse(Brushes.Black, new RectangleF(60,35, 10,10));
            }
            else if(mMscStyle == MscStyle.UML2){

                drawDestination.DrawString("Lost",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
                drawDestination.DrawString("g",new Font("Arial",8),Brushes.Black,itemBox2,itemStringFormat);
                drawDestination.DrawLine(Pens.Black,10, 40, 60,40);
                drawDestination.DrawLine(Pens.Black,60, 40, 54,43);
                drawDestination.DrawLine(Pens.Black,60, 40, 54,37);
                drawDestination.FillEllipse(Brushes.Black, new RectangleF(60,35, 10,10));

            }
            itemStringFormat.Dispose();
        }
        public static void FillPill(Brush b, RectangleF rect, Graphics g)
        {
            if (rect.Width > rect.Height)
            {
                g.SmoothingMode = SmoothingMode.HighQuality;
                g.FillEllipse(b, new RectangleF(rect.Left, rect.Top, rect.Height, rect.Height));
                g.FillEllipse(b, new RectangleF(rect.Left + rect.Width - rect.Height, rect.Top, rect.Height, rect.Height));

                var w = rect.Width - rect.Height;
                var l = rect.Left + ((rect.Height) / 2);
                g.FillRectangle(b, new RectangleF(l, rect.Top, w, rect.Height));
                g.SmoothingMode = SmoothingMode.Default;
            }
            else if (rect.Width < rect.Height)
            {
                g.SmoothingMode = SmoothingMode.HighQuality;
                g.FillEllipse(b, new RectangleF(rect.Left, rect.Top, rect.Width, rect.Width));
                g.FillEllipse(b, new RectangleF(rect.Left, rect.Top + rect.Height - rect.Width, rect.Width, rect.Width));

                var t = rect.Top + (rect.Width / 2);
                var h = rect.Height - rect.Width;
                g.FillRectangle(b, new RectangleF(rect.Left, t, rect.Width, h));
                g.SmoothingMode = SmoothingMode.Default;
            }
            else if (rect.Width == rect.Height)
            {
                g.SmoothingMode = SmoothingMode.HighQuality;
                g.FillEllipse(b, rect);
                g.SmoothingMode = SmoothingMode.Default;
            }
        }
		public void Draw(Graphics g, Size mapSize)
		{
			bool drawSquares = false;
			var galaxyMap = GalaxyMap.Instance;
			var galaxy = galaxyMap.Galaxy;
			var faction = galaxy.GetFaction(Planet);
			var color = faction != null ? faction.Color : Color.White;
			using (var brush = new SolidBrush(color)) {
				var x1 = (int)(Position.X*mapSize.Width - PlanetSize/2);
				var y1 = (int)(Position.Y*mapSize.Height - PlanetSize/2);

             
                g.FillEllipse(Brushes.Black, x1 - OutlineSize, y1 - OutlineSize, PlanetSize + OutlineSize * 2, PlanetSize + OutlineSize * 2);
				g.FillEllipse(brush, x1, y1, PlanetSize, PlanetSize);

                

				if (drawSquares) {
					g.SmoothingMode = SmoothingMode.None;
					g.InterpolationMode = InterpolationMode.NearestNeighbor;

					Faction attackFaction;
					var found = galaxyMap.AttackablePlanetIDs.TryGetValue(Planet.ID, out attackFaction);
					if (found) {
						g.DrawRectangle(new Pen(attackFaction.Color, 3), x1, y1, PlanetSize, PlanetSize);
					}

					if (galaxyMap.ClaimablePlanetIDs.Contains(Planet.ID)) {
						g.DrawRectangle(new Pen(Color.Purple, 3), x1, y1, PlanetSize, PlanetSize);
					}
					g.SmoothingMode = SmoothingMode.AntiAlias;
					g.InterpolationMode = InterpolationMode.HighQualityBicubic;
				}
			}
		}
Example #4
0
		public override void Draw(Graphics aGfx,int alWorldX,int alWorldY ,eEditMode mMode, bool abSelected)
		{
			Color Col;
			
			if(mMode == eEditMode.Lights)
			{
				Col = abSelected?Color.FromArgb(80,255,80):Color.FromArgb(255,0,255);
				
				SolidBrush CenterBrush = new SolidBrush(Col);
				aGfx.FillEllipse(CenterBrush,mlX-10-alWorldX,mlY-10-alWorldY,
					20,20);
				CenterBrush.Dispose();
			}
			else
			{
				Col = Color.Gray;
				SolidBrush CenterBrush = new SolidBrush(Col);
				aGfx.FillEllipse(CenterBrush,mlX-3-alWorldX,mlY-3-alWorldY,
					6,6);
				CenterBrush.Dispose();
			}


            Pen OuterPen = new Pen(Col);
			aGfx.DrawEllipse(OuterPen,mlX-mfRadius-alWorldX,mlY-mfRadius-alWorldY,
							mfRadius*2,mfRadius*2);
			OuterPen.Dispose();
		}
    /// <summary>
    /// Draws a breakpoint icon in the margin.
    /// </summary>
    /// <param name="g">The <see cref="Graphics"/> context.</param>
    /// <param name="rectangle">The bounding rectangle.</param>
    /// <param name="isEnabled"><c>true</c> if enabled..</param>
    /// <param name="willBeHit"><c>true</c> if it will be hit.</param>
    public static void DrawBreakpoint(Graphics g, Rectangle rectangle, bool isEnabled, bool willBeHit)
    {
      int diameter = Math.Min(rectangle.Width - 4, rectangle.Height);
      Rectangle rect = new Rectangle(2, rectangle.Y + (rectangle.Height - diameter) / 2, diameter, diameter);

      using (GraphicsPath path = new GraphicsPath())
      {
        path.AddEllipse(rect);
        using (PathGradientBrush pthGrBrush = new PathGradientBrush(path))
        {
          pthGrBrush.CenterPoint = new PointF(rect.Left + rect.Width / 3, rect.Top + rect.Height / 3);
          pthGrBrush.CenterColor = Color.MistyRose;
          Color[] colors = { willBeHit ? Color.Firebrick : Color.Olive };
          pthGrBrush.SurroundColors = colors;

          if (isEnabled)
          {
            g.FillEllipse(pthGrBrush, rect);
          }
          else
          {
            g.FillEllipse(SystemBrushes.Control, rect);
            using (Pen pen = new Pen(pthGrBrush))
            {
              g.DrawEllipse(pen, new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height - 2));
            }
          }
        }
      }
    }
Example #6
0
        internal override void Render(Graphics graphics, SizeF minimumSize, PointF location)
        {
            var size = Measure(graphics);
            size.Width = Math.Max(minimumSize.Width, size.Width);
            size.Height = Math.Max(minimumSize.Height, size.Height);

            Brush incomingSignalColor = Brushes.LightSteelBlue;
            Brush ownSignalColor = Brushes.LightSteelBlue;

            if (m_signal.IsIncomingRised())
            {
                incomingSignalColor = Brushes.LimeGreen;
            }

            if (m_signal.IsDropped())
            {
                ownSignalColor = Brushes.Tomato;
            }
            if (m_signal.IsRised())
            {
                ownSignalColor = Brushes.LimeGreen;
            }

            graphics.FillEllipse(incomingSignalColor, location.X + SIGNAL_OFFSET, location.Y + SIGNAL_OFFSET, SIGNAL_SIZE, SIGNAL_SIZE);
            graphics.DrawEllipse(Pens.DimGray, location.X + SIGNAL_OFFSET, location.Y + SIGNAL_OFFSET, SIGNAL_SIZE, SIGNAL_SIZE);

            graphics.FillEllipse(ownSignalColor, location.X + 2 * SIGNAL_OFFSET + SIGNAL_SIZE, location.Y + SIGNAL_OFFSET, SIGNAL_SIZE, SIGNAL_SIZE);
            graphics.DrawEllipse(Pens.DimGray, location.X + 2 * SIGNAL_OFFSET + SIGNAL_SIZE, location.Y + SIGNAL_OFFSET, SIGNAL_SIZE, SIGNAL_SIZE);

            graphics.DrawString(this.Text, SystemFonts.MenuFont, Brushes.Black, new RectangleF(location, size), GraphConstants.RightTextStringFormat);
        }
        /// <summary>
        /// Overridden. Draws the content of the QTabButton button, here the extra CloseButton is painted.
        /// </summary>
        protected override void DrawTabButtonContent(QTabButton button, QTabButtonConfiguration buttonConfiguration, string text, Icon icon, Color replaceColor, Color replaceColorWith, Color textColor, Font font, Rectangle bounds, Graphics graphics)
        {
            //First call the base.
            base.DrawTabButtonContent(button, buttonConfiguration, text, icon, replaceColor, replaceColorWith, textColor, font, bounds, graphics);

            //Get the QTabCloseButton.
            QTabCloseButton tmp_oButton = button.Control.Tag as QTabCloseButton;

            if (tmp_oButton != null)
            {
                //Set the bounds.
                tmp_oButton.Bounds = new Rectangle(bounds.Right + 2, bounds.Top + 3, 10, 11);

                //Determine its state and draw an Ellipse and a Cross image.
                if ((tmp_oButton.IsPressed) && (tmp_oButton.IsHot))
                {
                    graphics.FillEllipse(Brushes.DarkRed, new QPadding(2, 2, 1, 1).InflateRectangleWithPadding(tmp_oButton.Bounds, true, true));
                    QControlPaint.DrawImage(QTabCloseButton.CloseMask, Color.Red, Color.White, QImageAlign.Centered, tmp_oButton.Bounds, QTabCloseButton.CloseMask.Size, graphics);
                }
                else if (tmp_oButton.IsHot)
                {
                    graphics.FillEllipse(Brushes.Red, new QPadding(2,2,1,1).InflateRectangleWithPadding(tmp_oButton.Bounds, true, true));
                    QControlPaint.DrawImage(QTabCloseButton.CloseMask, Color.Red, Color.White, QImageAlign.Centered, tmp_oButton.Bounds, QTabCloseButton.CloseMask.Size, graphics);
                }
                else
                {
                    QControlPaint.DrawImage(QTabCloseButton.CloseMask, Color.Red, Color.FromArgb(50,50,50), QImageAlign.Centered, tmp_oButton.Bounds, QTabCloseButton.CloseMask.Size, graphics);
                }

            }

        }
Example #8
0
        public override void Draw(Graphics g)
        {
            RectangleF rect = rectComponent.TopLeftCorner.CloneAndAdd(0, offSet).MakeRectangleFTill(rectComponent.BottomRightCorner.CloneAndAdd(0, -offSet));
            RectangleF upperRect = rectComponent.TopLeftCorner.MakeRectangleFTill(rectComponent.TopLeftCorner.CloneAndAdd(rectComponent.Width, 2 * offSet));
            RectangleF lowerRect = rectComponent.BottomRightCorner.CloneAndAdd(-rectComponent.Width, -2 * offSet).MakeRectangleFTill(rectComponent.BottomRightCorner);

            using (LinearGradientBrush brush =
                new LinearGradientBrush(rect, ViewFactory.GradStartColor, ViewFactory.GradEndColor, 90.0f))
            {
                g.FillRectangle(brush, rect);
                g.DrawRectangle(ViewFactory.BorderPen, rect.X, rect.Y, rect.Width, rect.Height);
            }


            using (LinearGradientBrush brush =
                new LinearGradientBrush(upperRect, ViewFactory.GradStartColor, ViewFactory.GradEndColor, 90.0f))
            {
                g.FillEllipse(brush, upperRect);
                g.DrawEllipse(ViewFactory.BorderPen, upperRect.X, upperRect.Y, upperRect.Width, upperRect.Height);
            }

            using (LinearGradientBrush brush =
                new LinearGradientBrush(lowerRect, ViewFactory.GradStartColor, ViewFactory.GradEndColor, 90.0f))
            {
                g.FillEllipse(brush, lowerRect);
                g.DrawArc(ViewFactory.BorderPen, lowerRect, 0, 180);
            }
            base.Draw(g);
        }
        public override void drawnShap(Graphics pe)
        {
            Brush CurrentBrush = initBrush();
            if (this.State.Shift1 == true)
            {
                calcShift();

                findSecondPointWhenShift();

                pe.DrawEllipse(new Pen(State.CurrentColor, State.LineWidth), State.StartPoint.X, State.StartPoint.Y, State.Width1, State.Width1);
                if (State.IsBrushFill == true)
                {
                    pe.FillEllipse(CurrentBrush, State.StartPoint.X, State.StartPoint.Y, State.Width1, State.Width1);
                }
            }
            else
            {
                calcHeightWidth();
                pe.DrawEllipse(new Pen(State.CurrentColor, State.LineWidth), State.StartPoint.X, State.StartPoint.Y, State.Width1, State.Height1);

                if (State.IsBrushFill == true)
                {
                    pe.FillEllipse(CurrentBrush, State.StartPoint.X, State.StartPoint.Y, State.Width1, State.Height1);
                }
            }


        }
Example #10
0
 public static void RepertoryImage(Graphics drawDestination)
 {
     StringFormat itemStringFormat = new StringFormat();
     RectangleF itemBox = new RectangleF(15, 30, 50, 20);
     itemStringFormat.Alignment = StringAlignment.Center;
     itemStringFormat.LineAlignment = StringAlignment.Center;
     drawDestination.DrawLine(Pens.LightGray,40,10,40,70);
     if (mMscStyle == MscStyle.SDL){
         PointF[] statePolygon = new PointF[6];
         statePolygon[0] = new PointF(5,40);
         statePolygon[1] = new PointF(15,30);
         statePolygon[2] = new PointF(65,30);
         statePolygon[3] = new PointF(75,40);
         statePolygon[4] = new PointF(65,50);
         statePolygon[5] = new PointF(15,50);
         drawDestination.FillPolygon(Brushes.White,statePolygon);
         drawDestination.DrawString("State",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
         drawDestination.DrawPolygon(Pens.Black,statePolygon);
     }
     else if(mMscStyle == MscStyle.UML2){
             drawDestination.FillRectangle(Brushes.White,itemBox);
             drawDestination.FillEllipse(Brushes.White,5,30,20,20);
             drawDestination.FillEllipse(Brushes.White,55,30,20,20);
             drawDestination.DrawLine(Pens.Black,15,30,65,30);
             drawDestination.DrawLine(Pens.Black,15,50,65,50);
             drawDestination.DrawArc(Pens.Black,5,30,20,20,90,180);
             drawDestination.DrawArc(Pens.Black,55,30,20,20,270,180);
             drawDestination.DrawString("State",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
     }
     itemStringFormat.Dispose();
 }
Example #11
0
 /// <summary>
 /// Draw a Vertex
 /// </summary>
 public static void DrawEdge(Graphics g, IEdge e, PointF pSource, PointF pTarget, bool highLight = false)
 {
     var ps = pSource;
     var pt = pTarget;
     g.DrawLine(highLight ? penHighLight : penEdge, ps, pt);
     g.FillEllipse(highLight ? brushHighLight : brushEdgePoint, (pt.X + ps.X) / 2 - 2, (pt.Y + ps.Y) / 2 - 2, 4, 4);
     g.FillEllipse(highLight ? brushHighLight : brushEdgePoint, (pt.X * 2 + 3 * ps.X) / 5 - 4, (pt.Y * 2 + ps.Y * 3) / 5 - 4, 8, 8);
 }
Example #12
0
 public override void Draw(Graphics g, string str)
 {
     switch(str)
     {
         case "XY": g.FillEllipse(new SolidBrush(Color.Black), _x, g.VisibleClipBounds.Height - _y, 6, 6); break;
         case "XZ": g.FillEllipse(new SolidBrush(Color.Black), _x, g.VisibleClipBounds.Height - _z, 6, 6); break;
         case "YZ": g.FillEllipse(new SolidBrush(Color.Black), _y, g.VisibleClipBounds.Height - _z, 6, 6); break;
         default: break;
     }
 }
Example #13
0
 public void draw(Graphics g)
 {
     Pen p = new Pen(Brushes.Black, 3);
     g.DrawLine(p, new Point( Width / 2-1,0),new Point( Width / 2-1,Height));
     g.DrawLine(p, new Point(0, Height/2-1), new Point(Width, Height/2-1));
     if (hasCheck==1)
         g.FillEllipse(Brushes.Black, new Rectangle(0, 0, 25, 25));
     else if(hasCheck==2)
         g.FillEllipse(Brushes.White, new Rectangle(0, 0, 25, 25));
 }
Example #14
0
 private void DrawRoundRect(Graphics g, Brush br, Rectangle area)
 {
     int rd = 8;
     g.FillEllipse(br, area.X, area.Y, rd * 2, rd * 2);
     g.FillEllipse(br, area.X, area.Y + area.Height - rd * 2, rd * 2, rd * 2);
     g.FillEllipse(br, area.X + area.Width - rd * 2, area.Y, rd * 2, rd * 2);
     g.FillEllipse(br, area.X + area.Width - rd * 2, area.Y + area.Height - rd * 2, rd * 2, rd * 2);
     g.FillRectangle(br, area.X , area.Y + rd, area.Width+1, area.Height - rd*2);
     g.FillRectangle(br, area.X + rd, area.Y, area.Width - rd * 2, area.Height+1);
 }
Example #15
0
        public void Draw(Graphics g)
        {
            float r = this.r / 4;

            float d = (float)Math.Sqrt(this.vx * this.vx + this.vy * this.vy);
            if (d != 0.0f) {
                float vx = this.vx / d;
                float vy = this.vy / d;
                float vx_ = vy;
                float vy_ = -vx;

                PointF[] points = new PointF[3];
                points[0] = new PointF(this.px + this.r * vx_, this.py + this.r * vy_);
                points[1] = new PointF(this.px + 3 * this.r / 2 * vx, this.py + 3 * this.r / 2 * vy);
                points[2] = new PointF(this.px - this.r * vx_, this.py - this.r * vy_);
                Brush brush = new SolidBrush(Color.FromArgb(150, Color.Blue));
                g.FillPolygon(brush, points);

                float x;
                float y;

                float rFoot = this.r - r / 2;
                float rHand = 2 * r;
                float koef = (float)Math.Sin(this.t / rFoot * (float)Math.PI);
                float dFoot = rFoot * koef;
                float dHand = rHand * koef;

                x = this.px + vx_ * (this.r - r) + dHand * vx;
                y = this.py + vy_ * (this.r - r) + dHand * vy;
                g.FillEllipse(this.brush, x - r, y - r, 2 * r, 2 * r);
                g.DrawEllipse(this.pen, x - r, y - r, 2 * r, 2 * r);

                x = this.px + vx_ * r - dFoot * vx;
                y = this.py + vy_ * r - dFoot * vy;
                g.FillEllipse(this.brush, x - r, y - r, 2 * r, 2 * r);
                g.DrawEllipse(this.pen, x - r, y - r, 2 * r, 2 * r);

                x = this.px - vx_ * (this.r - r) - dHand * vx;
                y = this.py - vy_ * (this.r - r) - dHand * vy;
                g.FillEllipse(this.brush, x - r, y - r, 2 * r, 2 * r);
                g.DrawEllipse(this.pen, x - r, y - r, 2 * r, 2 * r);

                x = this.px - vx_ * r + dFoot * vx;
                y = this.py - vy_ * r + dFoot * vy;
                g.FillEllipse(this.brush, x - r, y - r, 2 * r, 2 * r);
                g.DrawEllipse(this.pen, x - r, y - r, 2 * r, 2 * r);

                this.t += d;
            } else {
                this.t = 0.0f;
            }

            g.FillEllipse(this.brush, this.px - this.r, this.py - this.r, 2 * this.r, 2 * this.r);
            g.DrawEllipse(this.pen, this.px - this.r, this.py - this.r, 2 * this.r, 2 * this.r);
        }
Example #16
0
        public void Draw(Graphics g)
        {
            if (StartPos != Point.Empty)
            {
                if (blink)
                    g.FillEllipse(Brushes.Red, StartPos.X, StartPos.Y, 10, 10);
                else
                    g.FillEllipse(Brushes.Blue, StartPos.X, StartPos.Y, 10, 10);

                blink = !blink;
            }
        }
        public void Draw(Graphics g)
        {
            // Head
            g.FillEllipse(mBrush, mListenerPos.x - SIZE, mListenerPos.y - SIZE, SIZE*2, SIZE*2);

            // Nose
            g.FillEllipse(mBrush, mListenerPos.x - SIZE/2, mListenerPos.y - SIZE - 5, SIZE, SIZE);

            // Ears
            g.FillEllipse(mBrush, mListenerPos.x - SIZE - 5, mListenerPos.y - SIZE/2, SIZE, SIZE);
            g.FillEllipse(mBrush, mListenerPos.x + SIZE - 10, mListenerPos.y - SIZE/2, SIZE, SIZE);
        }
Example #18
0
        public void drawSelf(Graphics g, Pen p)
        {
            int origin = (size / 2);

            if (selected)
            {
                g.FillEllipse(new SolidBrush(Color.FromArgb(64, 255, 255, 255)), position.X + origin, position.Y + origin, size, size);

            }
            g.DrawEllipse(p, position.X, position.Y, size, size);
            g.FillEllipse(Brushes.Red, position.X + origin + (origin /2), position.Y + origin + (origin / 2), size / 2, size / 2);
        }
Example #19
0
        private void drawCircle()
        {
            bmp = new Bitmap((int)pbWIDTH, (int)pbHEIGHT);
            Pen pen = new Pen(Brushes.Black, width_pen);
            g = Graphics.FromImage(bmp);
            if (stan==0) g.FillEllipse(Brushes.White, (int)((pbHEIGHT - pbHEIGHT / 1.15) / 2), (int)((pbHEIGHT - pbHEIGHT / 1.15) / 2), (int)(pbHEIGHT / 1.15), (int)(pbWIDTH / 1.15));
            if (stan == 1) g.FillEllipse(Brushes.LightGreen, (int)((pbHEIGHT - pbHEIGHT / 1.15) / 2), (int)((pbHEIGHT - pbHEIGHT / 1.15) / 2), (int)(pbHEIGHT / 1.15), (int)(pbWIDTH / 1.15));
            if (stan == 2) g.FillEllipse(Brushes.Red, (int)((pbHEIGHT - pbHEIGHT / 1.15) / 2), (int)((pbHEIGHT - pbHEIGHT / 1.15) / 2), (int)(pbHEIGHT / 1.15), (int)(pbWIDTH / 1.15));

            g.DrawEllipse(pen, (int)((pbHEIGHT - pbHEIGHT/1.15)/2), (int)((pbHEIGHT - pbHEIGHT / 1.15) / 2), (int)(pbHEIGHT/1.15), (int)(pbWIDTH/1.15));
            g.DrawString("Pompa", new Font("Arial", 10), Brushes.Black, pbWIDTH / 4.7F, pbHEIGHT / 2.8F);
            
        }
 public override void Draw(Graphics g)
 {
     if (MyState)
     {
         g.FillEllipse(Brushes.Red, pos.X, pos.Y, box.Width, box.Height);
         g.DrawString(this.text, this.font, Brushes.Black, pos.X + 2 , pos.Y + 3 );
     }
     else
     {
         g.FillEllipse(Brushes.Black, pos.X, pos.Y, box.Width, box.Height);
         g.DrawString(this.text, this.font, Brushes.White, pos.X + 2 , pos.Y + 3);
     }
 }
Example #21
0
 //Get circle
 public void GetCircle(Point center, int radius, Pen borderPen, Pen mainPen, Graphics graph)
 {
     Rectangle rect = new Rectangle(center.X - radius / 2, center.Y - radius / 2, radius, radius);
     if (borderPen.Width == 0)
     {
         graph.FillEllipse(mainPen.Brush, rect);
     }
     else
     {
         graph.FillEllipse(mainPen.Brush, rect);
         graph.DrawEllipse(borderPen, rect);
     }
 }
Example #22
0
 public void render(Graphics g)
 {
     for (int i = 0; i < gObjects.Length; i++)
         g.FillEllipse(Brushes.Blue,
             gObjects[i].Position.X - (gObjects[i].Mass * Params.gBodyDrawScale) / 2,
             gObjects[i].Position.Y - (gObjects[i].Mass * Params.gBodyDrawScale) / 2,
             gObjects[i].Mass * Params.gBodyDrawScale,
             gObjects[i].Mass * Params.gBodyDrawScale);
     g.FillEllipse(Brushes.Green, startPos.X - 5, startPos.Y - 5, 10, 10);
     g.FillEllipse(Brushes.Red, goal.X - 5, goal.Y - 5, 10, 10);
     for (int i = 0; i < ships.Count; i++)
         g.FillRectangle(Brushes.Black, ships[i].X - 2, ships[i].Y - 2, 4, 4);
 }
Example #23
0
        public void Draw(Graphics g)
        {
            g.FillEllipse(Brushes.Blue, hotspotRect);

            //Getting how big the progress circle will be
            int fillWidth = (hotspotRect.Width / 100) * percentFill;
            int fillHeight = (hotspotRect.Width / 100) * percentFill;

            //Make the progress circle centered to the hotspot rectangle
            int xPos = (hotspotRect.Width - fillWidth) / 2;
            int yPos = (hotspotRect.Width - fillHeight) / 2;
            g.FillEllipse(Brushes.Red, xPos, yPos, fillWidth, fillHeight);
        }
Example #24
0
        public void Draw(Graphics grafico)
        {
            Pen p = new Pen(Color.Black);

            grafico.DrawEllipse(p,r1);
            grafico.FillEllipse(brs[0],r1);
            grafico.DrawEllipse(p,r2);
            grafico.FillEllipse(brs[1],r2);
            grafico.DrawEllipse(p,r3);
            grafico.FillEllipse(brs[2],r3);
            grafico.DrawEllipse(p,r4);
            grafico.FillEllipse(brs[3],r4);
        }
Example #25
0
        // for version 2.0, ignore newBrush and speed, use them in version 2.1
        public void Draw(Graphics g)
        {
            if (width > height)     // going horizontal
            {
                g.FillRectangle(myBrush, x, y, width, height);
                g.FillRectangle(Brushes.DarkBlue, x + 4, y - 2, 5, 3);  // window
                g.FillEllipse(Brushes.Black, x + 3, y + 4, 4, 5);       // left tire
                g.FillEllipse(Brushes.Black, x + width - 7, y + 4, 4, 5);   // right tire
            }

            else if (width < height)     // going horizontal
            {
                g.FillRectangle(myBrush, x, y, width, height);
                g.FillRectangle(Brushes.DarkBlue, x + 4, y - 2, 5, 3);  // window
                g.FillEllipse(Brushes.Black, x + 3, y + 4, 4, 5);       // left tire
                g.FillEllipse(Brushes.Black, x + width - 7, y + 4, 4, 5);   // right tire
            }

            else                    // going vertical
            {
                g.FillRectangle(myBrush, x, y, width, height);
                g.FillRectangle(Brushes.DarkBlue, x + 4, y - 2, 5, 3);  // window
                g.FillEllipse(Brushes.Black, x + 3, y + 4, 4, 5);       // left tire
                g.FillEllipse(Brushes.Black, x + width - 7, y + 4, 4, 5);   // right tire
                g.FillEllipse(Brushes.Black, x + 3, y + 4, 4, 5);       // left tire
                g.FillEllipse(Brushes.Black, x + width - 7, y + 4, -4, -5);   // right tire

            }
        }
Example #26
0
File: Number.cs Project: AtanasK/VP
 public void Draw(Graphics g)
 {
     if (TimeAlive <= 2)
     {
         g.FillEllipse(Brushes.Red, Center.X - RADIUS, Center.Y - RADIUS, RADIUS * 2, RADIUS * 2);
     }
     else
     {
         g.FillEllipse(Brushes.Aqua, Center.X - RADIUS, Center.Y - RADIUS, RADIUS * 2, RADIUS * 2);
     }
     Font f = new Font("Arial", 24);
     g.DrawString(string.Format("{0}", Digit), f, Brushes.Black, Center.X - 15, Center.Y - 15);
     f.Dispose();
 }
 public void draw(Graphics g, Light color)
 {
     if (color == Light.GREEN) {
         topLight = new SolidBrush(Color.Green);
         buttomLight = new SolidBrush(Color.Gray);
     } else {
         topLight = new SolidBrush(Color.Gray);
         buttomLight = new SolidBrush(Color.Red);
     }
     g.FillRectangle(back, new Rectangle(40, 10, 70, 130));
     g.FillRectangle(back, new Rectangle(70, 130, 10, 200));
     g.FillEllipse(topLight, new Rectangle(50, 20, 50, 50));
     g.FillEllipse(buttomLight, new Rectangle(50, 80, 50, 50));
 }
Example #28
0
        public override void Draw(Graphics gfx)
        {
            if (Enabled)
                gfx.DrawEllipse(new Pen(Color.Gray, 0.025f), point.X - 0.1f, point.Y - 0.1f, 0.2f, 0.2f);

            gfx.FillEllipse(Highlighted ? Brushes.Purple : Brushes.Black, point.X - size / 2, point.Y - size / 2, size, size);

            if (size >= 0.05)
            {
                //draw larger cities with a red center circle
                float centerSize = size / 2;
                gfx.FillEllipse(Brushes.DarkRed, point.X - centerSize / 2, point.Y - centerSize / 2, centerSize, centerSize);
            }
        }
Example #29
0
 public void Draw(Graphics g)
 {
     if (IsHit)
     {
         g.FillEllipse(Brushes.Red, Center.X - RADIUS, Center.Y - RADIUS, RADIUS * 2, RADIUS * 2);
     }
     else
     {
         g.FillEllipse(Brushes.LightGreen, Center.X - RADIUS, Center.Y - RADIUS, RADIUS * 2, RADIUS * 2);
     }
     Font f = new Font("Arial", 24);
     g.DrawString(string.Format("{0}", Letter), f, Brushes.Black, Center.X - 15, Center.Y - 15);
     f.Dispose();
 }
Example #30
0
        public override void DrawSelf(Graphics gfx, Pen pen)
        {
            if (Center == Target)
            {
                gfx.FillEllipse(Brushes.Gainsboro, Center.X - (Width / 2), Center.Y - Height / 2, Width, Height);
            }
            else
            {
                //PointF a = new PointF(Center.X + 3, Center.Y);
                //PointF b = new PointF(Center.X + 3, Center.Y + 3);
                //PointF c = new PointF(Center.X - 3, Center.Y - 3);

                gfx.FillEllipse(Brushes.Black, Center.X - 2, Center.Y - 2, 4, 4);
            }
        }