As described in Windows and Viewports: The Coordinate Systems of Regions, displaying the contents of a region's window in the region's viewport is like using a camera. You control what is visible in the camera's lens by aiming the camera; what you see through the lens is like the window of a region. The viewport is like a snapshot; it is a picture of the window. The following sections describe the effects of altering the size and position of a window and viewport.
You might define a graphical region called Blackboard and a key called Round, as shown below. Round is defined as a child of Blackboard.
screen size 640 350
graphical region Blackboard size 150 150
at position 225 150
key Round at position 75 75 in Blackboard
circle radius 75
The viewport of the graphical region Blackboard is a rectangular area whose size is 150 coordinate positions wide and 150 coordinate positions high. The lower left corner of the viewport is at position 225 150 in the screen. Blackboard's window is the same size, and is initialized at position 0 0 in the graphical region.
The key Round consists of a single circle. The origin of the circle
(75 75) places it in the center of Blackboard's window. Since the radius of Round is 75 coordinate positions, it touches the outermost positions of Blackboard's window at four places. In the figure below and in the remaining figures in this section, the diagram on the left shows Blackboard's window positioned in the graphical region, and the diagram on the right shows Blackboard's viewport positioned on the display.
The examples are not cumulative; each starts with the original definitions of Blackboard and Round.
The entire contents of a region's window appear in the region's viewport, regardless of any distortion that might result. This means that if you change the proportions of either the viewport or the window, but do not change the proportions of the other, then the image that appears in the viewport is distorted.
It is important to remember that throughout all of the alterations in window and viewport size and position, the circle remains a complete graphical image in the graphical region, even though it might be clipped or otherwise altered on the display. Changing the shape or position of a region's viewport or window has no effect on the contents of the region itself, but only on what part of the region is visible on the display, where on the display it appears, and in what size and shape it is shown.