2.3. Tutorial: Your First GDI+ Application

In this section you’ll learn how to write your first GDI+ application, step-by-step. You will create a Windows application and draw a few simple objects, such as lines, rectangles, and ellipses, on a Windows Form.

Here are the steps we will cover:

  1. Creating a Windows application

  2. Adding references to the GDI+ library

  3. Obtaining the graphics surface

  4. Setting the graphics surface properties (optional)

  5. Drawing or filling graphics shapes

  6. Releasing objects

  7. Building and running the application

2.3.1. Creating a Windows Application

The first step of this tutorial is to create a Windows application using Visual Studio .NET.

1.
Open Visual Studio .NET, select File | New | Project, and then choose Visual C# Projects ...

Get Graphics Programming with GDI+ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.