In Chapter 5, we discussed how to use the ScaleTransform, RotateTransform, and TranslateTransform methods to transform text. We can also use a transformation matrix to transform text.
We create a Matrix object with the transformation properties and apply it on the surface using the Transform property of the Graphics object. Listing 10-19 creates a Matrix object and sets it as the Transform property. We then call DrawString, which draws the text on the form. To test this code, add the code to a Form's paint event handler.
Graphics g = e.Graphics;
Listing 10-19 Generates Figure 10-29.
You can apply shearing and other effects by changing the values of Matrix. For example, if you change Matrix as follows:
Matrix M =
Figure 10-30. Transforming Text
We can reverse the text by just changing the value of the Matrix object as follows:
This articles is taken from Chapter 10 "Transformations" of Graphics Programming with GDI+.