C Language Development Kit/Functions/SaveDisplay
From OptiWiki
< C Language Development Kit | Functions(Redirected from C Language Development Kit/Functions/savedisplay)
| Description | Saves the pixels of a screen display into a file. This function is useful when implementing
help screens after which the original screen must be restored. | ||||
| Syntax | int savedisplay(char * filename); | ||||
| Arguments | Points to a string containing the name of a file into which a screen display will be stored.
char * filename | ||||
| Returns |
| ||||
| Remarks | When the file cannot be opened or written to an error will be returned. The saved screen
can later be restored with the function loaddisplay(). The settings of the font, cursor and contrast from the orginal screen will also be saved. | ||||
| Example | #include "lib.h" #include <stdio.h> void main( void ) { int turn; printf("\fThis is screen\nnumber ONE."); savedisplay("screen1.dat"); delay( 100 ); printf("\fThis is screen\nnumber TWO."); savedisplay("screen2.dat"); turn = 1; for(;;) { resetkey(); while( !kbhit()) idle(); if( turn == 1) { loaddisplay("screen1.dat"); turn = 2; } else { loaddisplay("screen2.dat"); turn = 1; } } } |
