Transformation

In Chapter 9 we delved into advanced 2D graphics programming. In this chapter we will explore GDI+ transformations. A transformation is a process that changes graphics objects from one state to another. Rotation, scaling, reflection, translation, and shearing are some examples of transformation. Transformations can be applied not only to graphics shapes, curves, and images, but even to image colors.

In this chapter we will cover the following topics:

Any drawing process involves a source and a destination. The source of a drawing is the application that created it, and the destination is a display or printer device. For example, the process of drawing a simple rectangle starts with a command telling GDI+ to draw on the screen, followed by GDI+ iterating through multiple steps before it finally renders a rectangle on the screen. In the same way, transformation involves some steps before it actually renders the transformed object on a device. These steps are shown in Figure 10.1, which shows that GDI+ is responsible for converting world coordinates to page coordinates and device coordinates before it can render a transformed object.

Figure 10.1. Steps in the transformation process

Категории