CopyFromScreenMemory

Copies a rectangular region from screen memory

Local Servers:nonblocking
Remote Servers:N/A
Classification:3.x, 4.x, 5.x, 6.x
Service:Screen Handling

Syntax

  #include <nwconio.h>  
   
  void CopyFromScreenMemory  (  
     WORD    height,   
     WORD    width,   
     BYTE   *Rect,   
     WORD    beg_x,   
     WORD    beg_y); 
  

Parameters

height

(IN) Specifies the number of rows in the rectangular region.

width

(IN) Specifies the number of columns in the rectangular region.

Rect

(OUT) Points to the screen memory data.

beg_x

(IN) Specifies the starting column in the rectangular region.

beg_y

(IN) Specifies the starting row in the rectangular region.

Remarks

The CopyFromScreenMemory function copies a rectangular region, whose size is specified by width and height, from screen memory, starting from column beg_x and row beg_y.

Ensure that:

  • beg_x + width is less than or equal to the number of columns on the screen (currently always 80).

  • beg_y + height is less than or equal to the number of rows on the screen (currently always 25).

The rectangle is clipped to the screen’s borders if it is too big.

If either beg_x or beg_y is greater than either SCREEN_COLUMNS or SCREEN_ROWS, the function returns without writing anything to the array Rect.

The size of the array Rect must be:

  (2 * width * height) 
  

The array Rect is an array of char attribute pairs:

     struct cell  
     {  
        char   charValue;  
        char   attribute;  
     }; 
  

See Also

CopyToScreenMemory