Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Draw an ellipse in C#
To draw an ellipse, use the drawEllipse() method in C# that belong to the Graphics object. It has a pen object as well as a rectangle object.
You need windows form to draw shapes in C#.
Set graphics object.
Graphics g = this.CreateGraphics();
Now, the pen object.
Pen p = new Pen(new SolidBrush(Color.Red), 15);
The following is the rectangle object.
Rectangle r = new Rectangle(120, 60, 180, 180);
Now use the drawEllipse() method with the graphics object and add both the objects in it to draw an ellipse.
s.DrawEllipse(p, r);
Advertisements
