1.1 Basic elements and data structures

1.1.3 Viewports

An area of the screen that displays bitmaps is known as a viewport. Each viewport is a mapping between a bitmap and the screen, or between the bits in the bitmap and the pixels on the screen. The region of the screen in which the viewport displays output is called the screen clipping region.

When you create a viewport, you can attach an existing bitmap to it. If you do not specify a bitmap to attach, a new bitmap is created and attached to the viewport automatically. Any function that takes a bitmap as its argument can also take a viewport as the same argument and perform the function on the viewport's bitmap.

Unlike a window, a viewport is not surrounded by a border of any kind. Thus, a viewport can initially be invisible if its associated bitmap is cleared and has no set bits. If the associated bitmap contains set bits from graphics output, the viewport can be visible immediately.

Information on creating and manipulating viewports is provided in Chapter 2, "Bitmaps, Viewports, and Windows".


The Window Tool Kit - 9 SEP 1996

Generated with Harlequin WebMaker