.NET Samples - Windows Forms: GDI+

This section includes the following samples:

Text Sample

Brush Sample

Pen Sample

Image Sample

Text Sample

This sample demonstrates the creation and use of TrueType fonts in GDI+ in drawing text.

Namespaces used in this sample:

System; System.Drawing; System.ComponentModel; System.Windows.Forms; System.IO; System.Drawing.Text; System.Drawing.Drawing2D; System.Reflection

Classes used in this sample:

Font; Brush; String; SolidBrush; FontFamily; Graphics; Form; Image; TextureBrush; Component; Assembly; Style; StringFormat; Bitmap; Stream; Container; Control; Message; LinearGradientBrush; Thread; Application; MessageBox; PaintEventArgs; Exception; Icon; EventArgs

Brush Sample

This sample demonstrates the creation and use of GDI+ brushes to fill various GDI+ shapes.

Namespaces used in this sample:

System; System.Drawing; System.Windows.Forms; System.ComponentModel; System.IO; System.Drawing.Drawing2D; System.Reflection

Classes used in this sample:

Brush; Path; Form; Type; Graphics; SolidBrush; Brushes; Component; Style; Image; LinearGradientBrush; Container; HatchBrush; GraphicsPath; Assembly; PathGradientBrush; PaintEventArgs; Stream; Thread; Bitmap; Control; TextureBrush; Application; EventArgs

Pen Sample

This sample demonstrates the creation and use of GDI+ pens in drawing various lines and curves.

Namespaces used in this sample:

System; System.Drawing; System.Windows.Forms; System.ComponentModel; System.IO; System.Drawing.Drawing2D; System.Reflection

Classes used in this sample:

Brush; Pen; Image; Style; Form; TextureBrush; Component; Pens; Assembly; Graphics; Stream; Container; Bitmap; EventArgs; Thread; Icon; SolidBrush; PaintEventArgs; Control; Application

Image Sample

This sample demonstrates the creation and use of images using GDI+. The sample shows how to load images from a disk or from the Web, and how to save contents of generated images to disk.

Namespaces used in this sample:

System; System.Drawing; System.Windows.Forms; System.ComponentModel; System.Reflection; System.IO; System.Drawing.Text; System.Drawing.Imaging; System.Drawing.Drawing2D; System.Net

Classes used in this sample:

Image; Bitmap; Form; Font; Brush; Graphics; FontFamily; Stream; Component; Style; SolidBrush; Message; WebRequest; Pen; Container; MessageBox; Assembly; EventArgs; Button; Control; MemoryStream; Cache; TextureBrush; Exception; Application; CredentialCache; Trace; Thread; StackTrace; Stack; EventHandler; PaintEventArgs; String; ImageFormat