Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 999 -
All character codes and their attributes, included the rectangular
area that is enclosed by (y1,x1)-(y2,x2),can be got.
(The characters which are enclosed in above area)*4 bytes area must
be reserved as "BUF". The data form, stored in "BUF", is as follows.
Upper word Lower word
+-----------------+-------------------+
| Attribute | Character code |
+-----------------+-------------------+
The character code is FANUC character code, and the type of the
attribute is explained the same as that of "crt_settextattr". The
position on the memory is corresponding to the position on the screen
as follows.
Position on the memory Position on the screen
-------------------------------+---------------------------
buf+0 y1 , x1 (Top,left)
buf+1 y1 , x1+1
: :
buf+(x2-x1) y1 , x2
buf+(x2-x1)+1 y1+1 , x1
: :
buf+(x2-x1+1)*(y2-y1+1)-1 y2 , x2 (Bottom,right)
[Example]
The following program backs up and restores the displayed characters
of upper 3 rows on the 14 inch screen.
#include <crt.h>
#include <stdlib.h>
void example( void )
{
unsigned long *buf ;
/* allocate (3-line)*(80-column)*(4-byte) buffer */
buf = (unsigned long *)malloc( 3*80*4) ;
/* get text image */
crt_gettextimg( 1, 1, 3, 80, buf ) ;
......(another process)
/* restore text image */
crt_puttextimg( 1, 1, 3, 80, buf, 0 ) ;
/* free buffer */
free( buf ) ;
}