home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGC.ZIP / PROGC093.C < prev    next >
Text File  |  1988-04-10  |  1KB  |  28 lines

  1.  
  2. /************************************************************************/
  3. /* Save content of screen into a file 'picture.001'                     */
  4. /************************************************************************/
  5.  
  6. save_screen()
  7.         {
  8.         int     i, j, x, y, color;
  9.  
  10.         /* Display a pattern on the screen                              */
  11.  
  12.         cls();                                  /* Clear screen         */
  13.         for (j = 0; j < 4; j++)                 /* Loop over rows of b's*/
  14.                 for (i = 0; i < 4; i++)         /* Loop over columns    */
  15.                         {
  16.                         y     = j * 200/4;      /* Draw the box         */
  17.                         x     = i * 640/4;
  18.                         color = i + j * 4;
  19.                         solid_box(x, y, x + 640/4, y + 200/4, color);
  20.                         }
  21.         /* Save it into a file                                          */
  22.  
  23.         if (!screen_dump())
  24.                 printf("\n...Error while saving screen\n");
  25.         else
  26.                 printf("\n...Picture sucessfully saved\n");
  27.         }
  28.