Chapter 30: Introduction to GDI


Overview

In the previous chapter, the term GDI+ was briefly introduced when you looked at printing in the .NET Framework. In this chapter, you have a real introduction to programming using the Graphics Device Interface classes (GDI+), the drawing technology of the .NET Framework. Mapping applications, games, computer-aided design/computer-aided manufacturing (CAD/CAM), drawing programs, charting programs, and many other types of applications require developers to write graphics code for their Windows Forms applications. Writing custom controls can also require graphics code. With this latest class library, Microsoft has made writing graphics code easier than ever.

Writing graphics code is one of the most enjoyable programming tasks. It is very rewarding to change your code and immediately see the results in a visible form. Whether you are writing a custom graphics window that presents something in your application in a new and different way or writing a custom control that makes your application more stylish and more usable, your application will be well received by the general public.

First, this chapter explains the mechanics of drawing using GDI+, and you write a few simple graphical example programs. Then you take a high-level look at some of the extensive capabilities of GDI+ such as clipping.

After the overview of each of these topics, you look at the classes you can use to implement the features. Knowing what you can do and understanding the class hierarchy is half the battle.

In this chapter, you learn about:

  • Drawing surfaces as encapsulated by the Graphics class

  • Colors as defined by the Color structure

  • Drawing lines

  • Drawing shapes

  • Drawing text

  • Drawing images

  • Drawing into images (double-buffering)




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net