bas7advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GET Statement (Graphics) Details
  Syntax  Details  Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
The GET statement stores graphics images from the screen.
 
GET [STEP](x1!,y1!)-[STEP](x2!,y2!),arrayname[(indexes%)]
    ■ STEP makes the specified coordinates relative to the most recent
      point. For example, if the last point plotted were (10,10), then
      the actual coordinates referred to by STEP (5,10) would be (5+10,10+10)
      or (15,20). If the second coordinate pair in a GET statement has a
      STEP argument, it is relative to the first coordinate pair.
    ■ (x1!,y1!)-(x2!,y2!) specify the screen coordinates of opposite
      corners of the rectangular image to store.
    ■ The argument arrayname is the name assigned to the array that holds
      the image. This array can be of any numeric type; its dimensions must
      be large  enough to hold the entire image.
    ■ The arguments indexes% are numeric expressions indicating the element
      of the array where the saved image starts.
 
Usage Notes
    ■ The GET statement transfers a screen image into the array specified
      by arrayname. The PUT statement, associated with GET, transfers the
      image stored in the array onto the screen.
    ■ The following formula gives the required size of the array in bytes:
 
        4+INT(((x2-x1+1)*(bits-per-pixel-per-plane)+7)/8)*planes*((y2-y1)+1)
 
      The bits-per-pixel-per-plane and planes values depend on the
      screen mode set by the SCREEN statement.
 
                         Bits-per-pixel-
        Screen mode      per-plane           Planes
        ═══════════      ═══════════════     ═══════════════════════════
         1               2                   1
         2               1                   1
         7               1                   4
         8               1                   4
         9               1                   2 (if 64K of EGA memory)
                         1                   4 (if > 64K of EGA memory)
        10               1                   2
        11               1                   1
        12               1                   4
        13               8                   1
 
    ■ The bytes per element of an array are as follows:
          Two bytes for an integer array element.
          Four bytes for a long-integer array element.
          Four bytes for a single-precision array element.
          Eight bytes for a double-precision array element.
          Eight bytes for a currency array element.
      For example, suppose you wanted to use the GET statement to store an
      image in high resolution (SCREEN 2). If the coordinates of the upper-
      left corner of the image are (0,0), and the coordinates of the lower-
      right corner are (32,32), then the required size of the array is:
          4 + INT((33 * 1 + 7)/8) * 1 * (33), or 169 bytes.
      This means an integer array with 85 elements would be large enough
      to hold the image.
    ■ Unless the array type is integer or long, the contents of an array
      after a GET operation appear meaningless when inspected directly.
      Examining or manipulating noninteger arrays that contain graphics
      images can cause run-time errors.
    ■ GET and PUT statements operating on the same image should be
      executed in matching screen modes. This can be either the same screen
      mode or any screen modes with the same values for planes and bits-
      per-pixel-per-plane.
    ■ One of the most useful things that can be done with GET and
      PUT statements is animation. See help for the PUT statement for
      information about how PUT arguments can be used to display a
      stored image with special effects such as animation.