Graphical Device Interface (GDI+) In C#

Graphical Device Interface (GDI) In C#

GDI+ is next evolution of GDI for the .Net Platform. All GDI+ classes reside in the following namespaces: • System.Drawing • System.Text • System.Printing • System.Internal • System.Imaging • System.Drawing2D • System.Design The Graphics Class The Graphics class encapsulates GDI+ drawing surfaces. Before drawing any object (for example circle or rectangle) we have to create …

Graphical Device Interface (GDI) In C# Read More »

Sample Examples:

Drawing a rectangle   You can override OnPaint event of your form to draw an rectangle. The LinearGradientBrush encapsulates a brush and linear gradient.   protected override void OnPaint(PaintEventArgs pe) { Graphics g = pe.Graphics ; Rectangle rect = new Rectangle(50, 30, 100, 100); LinearGradientBrush lBrush = new LinearGradientBr ush(rect, Color.Red, Color.Yellow, LinearGradientMode.BackwardDiagonal); g.FillRectangle(lBrush, rect); …

Sample Examples: Read More »