1.5. Section 5: Using Transformations

All of the discussion and examples so far have been drawn in Visual Basic's native drawing units: pixels. By default, all of the Graphics object's filling and drawing methods work in pixels.

However, pixels may not always be the most convenient unit for you. For example, suppose you want to draw a simple bar chart showing sales figures between $1M and $30M for the years 1990 through 2000. Since you can't use pixel coordinates as large as (1995, 1,000,000), you'll need to perform some mathematical calculations to map these big values into something that will fit on your screen.

While you can perform those calculations yourself if you want to, the Graphics object provides transformation methods that can do ...

Get Visual Basic Graphics Programming 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.