Transformations

You might have noticed a couple of commands in the previous example that moved the regions into position by applying a translation to them. There are two basic ways of applying transforms to graphical objects in the Framework. You can use the methods provided, such as Translate or Rotate, or you can specify an explicit transformation matrix to be used.

By far, the easiest way for dealing with these kinds of operations is to use the methods that wrap the underlying matrix manipulations for you.

These operations allow you to do the following:

  • Translate— Move an object in the x or y plane by an offset.

  • Rotate— Spin an object about the origin.

  • RotateAt— Spin an object about a point other than the origin.

  • Scale— Magnify or reduce an object ...

Get C# and the .NET Framework: The C++ Perspective now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.