Purpose |
Expands a graphic target into virtual mode. |
Syntax |
GRAPHIC SET VIRTUAL nWidth&, nHeight& [,USERSIZE] |
Remarks |
VIRTUAL mode allows the attached graphic target
(control or window)
to display the contents of a larger virtual window. The
physical size of the display area is not changed. Instead,
the display area acts as a smaller viewport,
which can be moved around the larger virtual window to view one section
at a time. The
physical size of the display area is not changed. If
the graphic target is a
This statement may be used to change a target to VIRTUAL mode, or to change the sizes and UserSize option of an existing VIRTUAL target. When executed, a new virtual bitmap of the specified height and width is created. nWidth& and nHeight& are always specified in Pixels or Dialog Units, depending upon the original window creation. The original bitmap is copied, pixel for pixel, at the existing size. Any expanded area is filled with the current background color. Your program draws to it in the normal fashion for a bitmap of the new size. Scroll bars are added so the user can move the viewport to the desired section. The size of the viewport is not changed. The graphic viewport is initially placed at the upper-left corner of the virtual window. If a clip area had been established to create margins, it is reset. If scaled coordinates had been established, they are also reset, as neither would be appropriate for the altered size. You can enable these attributes again with GRAPHIC SCALE or GRAPHIC SET CLIP, based upon the new size of the drawing area. You can retrieve the size of the virtual drawing area, at any time, with GRAPHIC GET CANVAS. The graphic viewport can be moved by clicking the scrollbars, or by moving the mouse wheel to alter the vertical position. Depressing the control key, along with the mouse wheel, alters the horizontal position. In addition, the cursor movement keys (Left, Right, Up, Down, PageUp, PageDown, Home, End) may also be used for this purpose. VIRTUAL mode is quite similar to AUTOSIZE mode. Both create a virtual window which is the target of your drawing and text printing operations. The difference is the way in which they are displayed. VIRTUAL displays a viewport, smaller than the virtual window, which can be moved to various positions. This allows the user to view one selected section at a time. AUTOSIZE displays the entire virtual window, all of the time, by stretching or condensing it as needed. If you add the USERSIZE option, an attached graphic window is displayed with a thick frame, which allows the user to "drag" the edges to a new size at any time. This option is not appropriate for a graphic control, and is ignored in that case. Generally speaking, it is not advisable to enable ScrollText mode on a virtual graphic window, as the display may be confusing to the user. |
See also |
GRAPHIC GET CANVAS, GRAPHIC GET VIEW, GRAPHIC SET AUTOSIZE, GRAPHIC SET FIXED, GRAPHIC SET VIEW |