using System.Drawing; // ... Graphics graphics = this.CreateGraphics(); SolidBrush brush = new SolidBrush(Color.Blue); Rectangle rect = new Rectangle(50, 50, 100, 100); graphics.FillEllipse(brush, rect);
using System.Drawing; // ... Graphics graphics = this.CreateGraphics(); Rectangle rect = new Rectangle(50, 50, 100, 100); LinearGradientBrush brush = new LinearGradientBrush(rect, Color.Red, Color.Yellow, LinearGradientMode.Horizontal); graphics.FillEllipse(brush, rect);Package library: The System.Drawing namespace is part of the .NET Framework's Class Library.