/************************************************************************/ /* Save content of screen into a file 'picture.001' */ /************************************************************************/ save_screen() { int i, j, x, y, color; /* Display a pattern on the screen */ cls(); /* Clear screen */ for (j = 0; j < 4; j++) /* Loop over rows of b's*/ for (i = 0; i < 4; i++) /* Loop over columns */ { y = j * 200/4; /* Draw the box */ x = i * 640/4; color = i + j * 4; solid_box(x, y, x + 640/4, y + 200/4, color); } /* Save it into a file */ if (!screen_dump()) printf("\n...Error while saving screen\n"); else printf("\n...Picture sucessfully saved\n"); }