Description: The System.Windows.Media.DrawingContext class provides a set of methods that can be used to draw shapes on a visual surface. DrawEllipse method is one of them, which can be used to draw an ellipse.
Code Examples: 1. This code example demonstrates how to draw an ellipse using the DrawEllipse method:
DrawingContext dc = canvas.RenderOpen(); dc.DrawEllipse(Brushes.Red, null, new Point(100, 100), 50, 30); dc.Close();
This will draw a red ellipse with a width of 100 pixels and a height of 60 pixels on a canvas.
2. This code example demonstrates how to draw an ellipse with a stroke and fill using the DrawEllipse method:
DrawingContext dc = canvas.RenderOpen(); dc.DrawEllipse(Brushes.Red, new Pen(Brushes.Black, 2), new Point(100, 100), 50, 30); dc.Close();
This will draw a red ellipse with a black stroke of width 2 and a width of 100 pixels and a height of 60 pixels on a canvas.
Package Library: The package library for this method is in the System.Windows.Media class, which is included in the PresentationCore.dll assembly.
C# (CSharp) System.Windows.Media DrawingContext.DrawEllipse - 54 examples found. These are the top rated real world C# (CSharp) examples of System.Windows.Media.DrawingContext.DrawEllipse extracted from open source projects. You can rate examples to help us improve the quality of examples.