System.Drawing.Drawing2D.GraphicsPath.AddEllipse(System.Drawing.RectangleF)

Here are the examples of the csharp api class System.Drawing.Drawing2D.GraphicsPath.AddEllipse(System.Drawing.RectangleF) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

32 Examples 7

1. Example

Project: DotSpatial
Source File: SimpleSymbol.cs
public static void AddEllipse(GraphicsPath gp, SizeF scaledSize)
        {
            PointF upperLeft = new PointF(-scaledSize.Width / 2, -scaledSize.Height / 2);
            RectangleF destRect = new RectangleF(upperLeft, scaledSize);
            gp.AddEllipse(destRect);
        }

2. Example

Project: RNGReporter
Source File: GlassButton.cs
private static GraphicsPath CreateBottomRadialPath(Rectangle rectangle)
        {
            var path = new GraphicsPath();
            RectangleF rect = rectangle;
            rect.X -= rect.Width*.35f;
            rect.Y -= rect.Height*.15f;
            rect.Width *= 1.7f;
            rect.Height *= 2.3f;
            path.AddEllipse(rect);
            path.CloseFigure();
            return path;
        }

3. Example

Project: RNGReporter
Source File: GlassComboBox.cs
private static GraphicsPath CreateBottomRadialPath(Rectangle rectangle)
        {
            var path = new GraphicsPath();
            RectangleF rect = rectangle;
            rect.X -= rect.Width*.35f;
            rect.Y -= rect.Height*.15f;
            rect.Width *= 1.7f;
            rect.Height *= 2.3f;
            path.AddEllipse(rect);
            path.CloseFigure();
            return path;
        }

4. Example

Project: JexusManager
Source File: WindowsVistaRenderer.cs
private static GraphicsPath CreateBottomRadialPath ( Rectangle rectangle ) {
			GraphicsPath path = new GraphicsPath ();
			RectangleF rect = rectangle;
			rect.X -= rect.Width * .35f;
			rect.Y -= rect.Height * .15f;
			rect.Width *= 1.7f;
			rect.Height *= 2.3f;
			path.AddEllipse ( rect );
			path.CloseFigure ();
			return path;
		}

5. Example

Project: TDMaker
Source File: EllipseObj.cs
override public bool PointInBox( PointF pt, PaneBase pane, Graphics g, float scaleFactor )
		{
			if ( ! base.PointInBox(pt, pane, g, scaleFactor ) )
				return false;

			// transform the x,y location from the user-defined
			// coordinate frame to the screen pixel location
			RectangleF pixRect = _location.TransformRect( pane );

			using ( GraphicsPath path = new GraphicsPath() )
			{
				path.AddEllipse( pixRect );
				return path.IsVisible( pt );
			}
		}

6. Example

Project: ScpToolkit
Source File: ScpButton.cs
private static GraphicsPath CreateBottomRadialPath(Rectangle Rectangle)
        {
            var gp = new GraphicsPath();
            RectangleF rf = Rectangle;

            rf.X -= rf.Width*.35f;
            rf.Y -= rf.Height*.15f;

            rf.Width *= 1.7f;
            rf.Height *= 2.3f;

            gp.AddEllipse(rf);

            gp.CloseFigure();
            return gp;
        }

7. Example

Project: CityTrafficSimulator
Source File: LineNode.cs
private void UpdateNodeGraphics()
            {
            if ((position != null) && (inSlope != null) && (outSlope != null))
                {
                // Linien zu den Stützpunkten
                _nodeGraphics[0] = new System.Drawing.Drawing2D.GraphicsPath(new PointF[] { inSlopeAbs, position }, new byte[] { 1, 1 });
                _nodeGraphics[1] = new System.Drawing.Drawing2D.GraphicsPath(new PointF[] { outSlopeAbs, position }, new byte[] { 1, 1 });

                // Stützpunkte
                System.Drawing.Drawing2D.GraphicsPath inPoint = new System.Drawing.Drawing2D.GraphicsPath();
                inPoint.AddEllipse(inSlopeRect);
                _nodeGraphics[2] = inPoint;

                System.Drawing.Drawing2D.GraphicsPath outPoint = new System.Drawing.Drawing2D.GraphicsPath();
				// wir versuchen ein Dreieck zu zeichnen *lol*
				Vector2 dir = outSlope.Normalized;
				outPoint.AddPolygon(
					new PointF[] { 
						(6*dir) + outSlopeAbs, 
						(6*dir.RotateCounterClockwise(Math.PI * 2 / 3)) + outSlopeAbs,
						(6*dir.RotateCounterClockwise(Math.PI * 4 / 3)) + outSlopeAbs,
						(6*dir) + outSlopeAbs
					});
                _nodeGraphics[3] = outPoint;
                }
            }

8. Example

Project: ZedGraph
Source File: EllipseObj.cs
override public bool PointInBox( PointF pt, PaneBase pane, Graphics g, float scaleFactor )
		{
			if ( ! base.PointInBox(pt, pane, g, scaleFactor ) )
				return false;

			// transform the x,y location from the user-defined
			// coordinate frame to the screen pixel location
			RectangleF pixRect = _location.TransformRect( pane );

			using ( GraphicsPath path = new GraphicsPath() )
			{
				path.AddEllipse( pixRect );
				return path.IsVisible( pt );
			}
		}

9. Example

Project: dockpanelsuite
Source File: VisualStudioToolStripRenderer.cs
private static GraphicsPath GetCapsule(RectangleF baseRect)
        {
            RectangleF arc;
  /n ..... /n //View Source file for more details /n }

10. Example

Project: Toxy
Source File: GraphicsPathExtensions.cs
public static void AddCapsule(this GraphicsPath graphicsPath, RectangleF rect)
        {
            float diameter;
            RectangleF arc;

            try
            {
                if (rect.Width > rect.Height)
                {
                    // Horizontal capsule
                    diameter = rect.Height;
                    SizeF sizeF = new SizeF(diameter, diameter);
                    arc = new RectangleF(rect.Location, sizeF);
                    graphicsPath.AddArc(arc, 90, 180);
                    arc.X = rect.Right - diameter;
                    graphicsPath.AddArc(arc, 270, 180);
                }
                else if (rect.Width < rect.Height)
                {
                    // Vertical capsule
                    diameter = rect.Width;
                    SizeF sizeF = new SizeF(diameter, diameter);
                    arc = new RectangleF(rect.Location, sizeF);
                    graphicsPath.AddArc(arc, 180, 180);
                    arc.Y = rect.Bottom - diameter;
                    graphicsPath.AddArc(arc, 0, 180);
                }
                else
                {
                    // Circle
                    graphicsPath.AddEllipse(rect);
                }
            }
            catch
            {
                graphicsPath.AddEllipse(rect);
            }

            graphicsPath.CloseFigure();
        }

11. Example

Project: CMS
Source File: GraphicsExtenions.cs
private static GraphicsPath GetCapsule(RectangleF baseRect)
        {
            float diameter;
  /n ..... /n //View Source file for more details /n }

12. Example

Project: WorldSmith
Source File: VS2012ToolStripRenderer.cs
private static GraphicsPath GetCapsule(RectangleF baseRect)
        {
            RectangleF arc;
  /n ..... /n //View Source file for more details /n }

13. Example

Project: WorldSmith
Source File: VS2012ToolStripRenderer.cs
private static GraphicsPath GetCapsule(RectangleF baseRect)
        {
            RectangleF arc;
  /n ..... /n //View Source file for more details /n }

14. Example

Project: SirenOfShame
Source File: GraphicsHelpers.cs
private static GraphicsPath GenerateCapsule(
                this Graphics graphics,
                RectangleF rectangle)
        {
            float diameter;
            RectangleF arc;
            GraphicsPath path = new GraphicsPath();
            try
            {
                if (rectangle.Width > rectangle.Height)
                {
                    diameter = rectangle.Height;
                    SizeF sizeF = new SizeF(diameter, diameter);
                    arc = new RectangleF(rectangle.Location, sizeF);
                    path.AddArc(arc, 90, 180);
                    arc.X = rectangle.Right - diameter;
                    path.AddArc(arc, 270, 180);
                }
                else if (rectangle.Width < rectangle.Height)
                {
                    diameter = rectangle.Width;
                    SizeF sizeF = new SizeF(diameter, diameter);
                    arc = new RectangleF(rectangle.Location, sizeF);
                    path.AddArc(arc, 180, 180);
                    arc.Y = rectangle.Bottom - diameter;
                    path.AddArc(arc, 0, 180);
                }
                else path.AddEllipse(rectangle);
            }
            catch { path.AddEllipse(rectangle); }
            finally { path.CloseFigure(); }
            return path;
        }

15. Example

Project: ShareX
Source File: GraphicsPathExtensions.cs
public static void AddCapsule(this GraphicsPath gp, RectangleF rect)
        {
            float diameter;
            RectangleF arc;

            try
            {
                if (rect.Width > rect.Height)
                {
                    // Horizontal capsule
                    diameter = rect.Height;
                    SizeF sizeF = new SizeF(diameter, diameter);
                    arc = new RectangleF(rect.Location, sizeF);
                    gp.AddArc(arc, 90, 180);
                    arc.X = rect.Right - diameter;
                    gp.AddArc(arc, 270, 180);
                }
                else if (rect.Width < rect.Height)
                {
                    // Vertical capsule
                    diameter = rect.Width;
                    SizeF sizeF = new SizeF(diameter, diameter);
                    arc = new RectangleF(rect.Location, sizeF);
                    gp.AddArc(arc, 180, 180);
                    arc.Y = rect.Bottom - diameter;
                    gp.AddArc(arc, 0, 180);
                }
                else
                {
                    // Circle
                    gp.AddEllipse(rect);
                }
            }
            catch
            {
                gp.AddEllipse(rect);
            }

            gp.CloseFigure();
        }

16. Example

Project: NFirmwareEditor
Source File: CardPanel.cs
private static GraphicsPath GenerateCapsule(RectangleF rectangle)
		{
			var path = new GraphicsPath();
			try
			{
				float diameter;
				RectangleF arc;
				if (rectangle.Width > rectangle.Height)
				{
					diameter = rectangle.Height;
					var sizeF = new SizeF(diameter, diameter);
					arc = new RectangleF(rectangle.Location, sizeF);
					path.AddArc(arc, 90, 180);
					arc.X = rectangle.Right - diameter;
					path.AddArc(arc, 270, 180);
				}
				else if (rectangle.Width < rectangle.Height)
				{
					diameter = rectangle.Width;
					var sizeF = new SizeF(diameter, diameter);
					arc = new RectangleF(rectangle.Location, sizeF);
					path.AddArc(arc, 180, 180);
					arc.Y = rectangle.Bottom - diameter;
					path.AddArc(arc, 0, 180);
				}
				else path.AddEllipse(rectangle);
			}
			catch
			{
				path.AddEllipse(rectangle);
			}
			finally
			{
				path.CloseFigure();
			}
			return path;
		}

17. Example

Project: ShareX
Source File: GraphicsPathExtensions.cs
public static void AddCapsule(this GraphicsPath graphicsPath, RectangleF rect)
        {
            float diameter;
            RectangleF arc;

            try
            {
                if (rect.Width > rect.Height)
                {
                    // Horizontal capsule
                    diameter = rect.Height;
                    SizeF sizeF = new SizeF(diameter, diameter);
                    arc = new RectangleF(rect.Location, sizeF);
                    graphicsPath.AddArc(arc, 90, 180);
                    arc.X = rect.Right - diameter;
                    graphicsPath.AddArc(arc, 270, 180);
                }
                else if (rect.Width < rect.Height)
                {
                    // Vertical capsule
                    diameter = rect.Width;
                    SizeF sizeF = new SizeF(diameter, diameter);
                    arc = new RectangleF(rect.Location, sizeF);
                    graphicsPath.AddArc(arc, 180, 180);
                    arc.Y = rect.Bottom - diameter;
                    graphicsPath.AddArc(arc, 0, 180);
                }
                else
                {
                    // Circle
                    graphicsPath.AddEllipse(rect);
                }
            }
            catch
            {
                graphicsPath.AddEllipse(rect);
            }

            graphicsPath.CloseFigure();
        }

18. Example

Project: AnotherSc2Hack
Source File: HelpFunctions.cs
private static GraphicsPath GetCapsule(RectangleF baseRect)
            {
                var path =/n ..... /n //View Source file for more details /n }

19. Example

Project: AnotherSc2Hack
Source File: ExtentGraphics.cs
private static GraphicsPath GetCapsule(RectangleF baseRect)
        {
            var path = new Gra/n ..... /n //View Source file for more details /n }

20. Example

Project: Zydeo
Source File: GraphicsExtension.cs
private static GraphicsPath GenerateCapsule(
				this Graphics graphics,
				RectangleF rectangle)
		{
			float diameter;
			RectangleF arc;
			GraphicsPath path = new GraphicsPath();
			try
			{
				if (rectangle.Width > rectangle.Height)
				{
					diameter = rectangle.Height;
					SizeF sizeF = new SizeF(diameter, diameter);
					arc = new RectangleF(rectangle.Location, sizeF);
					path.AddArc(arc, 90, 180);
					arc.X = rectangle.Right - diameter;
					path.AddArc(arc, 270, 180);
				}
				else if (rectangle.Width < rectangle.Height)
				{
					diameter = rectangle.Width;
					SizeF sizeF = new SizeF(diameter, diameter);
					arc = new RectangleF(rectangle.Location, sizeF);
					path.AddArc(arc, 180, 180);
					arc.Y = rectangle.Bottom - diameter;
					path.AddArc(arc, 0, 180);
				}
				else path.AddEllipse(rectangle);
			}
			catch { path.AddEllipse(rectangle); }
			finally { path.CloseFigure(); }
			return path;
		}

21. Example

Project: Krypton
Source File: RenderStandard.cs
protected virtual void DrawRibbonAppButtonGlowCenter(Graphics g,
                                   /n ..... /n //View Source file for more details /n }

22. Example

Project: NGraphics
Source File: SystemDrawingPlatform.cs
public static System.Drawing.Brush GetBrush (this Brush brush, Rect frame)
		{
			var cb = brush as SolidBrush;
			if (cb != null) {
				return new System.Drawing.SolidBrush (cb.Color.GetColor ());
			}

            var lgb = brush as LinearGradientBrush;
            if (lgb != null) {
                var s = lgb.Absolute ? lgb.Start : frame.Position + lgb.Start * frame.Size;
                var e = lgb.Absolute ? lgb.End : frame.Position + lgb.End * frame.Size;
                var b = new System.Drawing.Drawing2D.LinearGradientBrush (GetPointF (s), GetPointF (e), System.Drawing.Color.Black, System.Drawing.Color.Black);
                var bb = BuildBlend (lgb.Stops);
                if (bb != null) {
                    b.InterpolationColors = bb;
                }
                return b;
            }

            var rgb = brush as RadialGradientBrush;
            if (rgb != null) {
                var r = rgb.GetAbsoluteRadius (frame);
                var c = rgb.GetAbsoluteCenter (frame);
                var path = new GraphicsPath ();
                path.AddEllipse (GetRectangleF (new Rect (c - r, 2 * r)));
                var b = new PathGradientBrush (path);
                var bb = BuildBlend (rgb.Stops, true);
                if (bb != null) {
                    b.InterpolationColors = bb;
                }
                return b;
            }

			throw new NotImplementedException ("Brush " + brush);
		}

23. Example

Project: trizbort
Source File: RoomPropertiesDialog.cs
private void pnlSampleRoomShape_Paint(object sender, PaintEventArgs e)
    {
      var graph = pnlSa/n ..... /n //View Source file for more details /n }

24. Example

Project: Aurora
Source File: EffectBrush.cs
public System.Drawing.Brush GetDrawingBrush()
        {
            if (true/*_drawingbrush == null*/n ..... /n //View Source file for more details /n }

25. Example

Project: Aurora
Source File: BrushUtils.cs
public static System.Drawing.Brush MediaBrushToDrawingBrush(System.Windows.Media.Brush in_brush)
   /n ..... /n //View Source file for more details /n }

26. Example

Project: Krypton
Source File: KryptonOffice2010Renderer.cs
public override void DrawBack(Graphics g, Rectangle rect)
            {
                Rectangle in/n ..... /n //View Source file for more details /n }

27. Example

Project: DotSpatial
Source File: GradientPattern.cs
public override void FillPath(Graphics g, GraphicsPath gp)
        {
            RectangleF bounds =/n ..... /n //View Source file for more details /n }

28. Example

Project: DotSpatial
Source File: ColorLever.cs
private void DrawColorSemicircle(Graphics g)
        {
            Rectangle bounds = GetSemicircleB/n ..... /n //View Source file for more details /n }

29. Example

Project: dx11
Source File: MainForm.cs
private void PaintDiagramFull(Graphics g) {
            if (_graph != null) {
                g.Clear(BackColor);

                var item = cbCircles.SelectedIndex;

                var gp = new GraphicsPath();
                var gp2 = new GraphicsPath();
                var gp3 = new GraphicsPath();
                foreach (var point in _graph.Sites) {
                    var r = new RectangleF(point.X - 2, point.Y - 2, 4, 4);
                    if (chkShowSites.Checked) {
                        gp.AddEllipse(r);
                    }

                    foreach (var edge in point.Edges) {
                        var start = edge.RightSite;
                        var end = edge.LeftSite;
                        if (item == 2) {
                            gp2.AddLine(start, end);
                            gp2.CloseFigure();
                        }


                    }
                    if (chkShowEdges.Checked) {
                        var visibleClipBounds = g.VisibleClipBounds;

                        var region = point.Region(visibleClipBounds).Where(p => p != null).Select(p => (PointF)p).ToArray();
                        if (region.Count() >= 3)
                            gp3.AddPolygon(region);
                    }
                }
                g.DrawPath(_circlePen, gp2);
                g.DrawPath(_edgePen, gp3);
                g.FillPath(_siteBrush, gp);
            }
        }

30. Example

Project: DropboxBusinessAdminTool
Source File: ButtonEx.cs
protected void PaintCustomBackground(PaintEventArgs e, Graphics g, Color tTopColorBegin, Color tTopC/n ..... /n //View Source file for more details /n }

31. Example

Project: VisualPlus
Source File: VisualColorPicker.cs
protected override void OnPaint(PaintEventArgs e)
        {
            Graphics graphics = e.Graphi/n ..... /n //View Source file for more details /n }

32. Example

Project: dx11
Source File: MainForm.cs
private void PaintDiagramIncremental(Graphics g) {
            if (_graph != null) {

              /n ..... /n //View Source file for more details /n }