home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Graphics / graphics-16000.iso / msdos / animutil / fastgfx / fg110c / 09-15.c < prev    next >
Text File  |  1992-01-30  |  805b  |  37 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. void main()
  8. {
  9.    int old_mode;
  10.    int read_status, write_status;
  11.  
  12.    if (fg_testmode(19,1) == 0) {
  13.       printf("This program requires a 320 ");
  14.       printf("x 200 MCGA graphics mode.\n");
  15.       exit(1);
  16.       }
  17.    old_mode = fg_getmode();
  18.    fg_setmode(19);
  19.  
  20.    read_status = fg_disppcx("coral.pcx",0);
  21.    fg_waitkey();
  22.    if (read_status == 0)
  23.       write_status = fg_makepcx(0,319,80,99,"new.pcx");
  24.    else
  25.       write_status = 1;
  26.  
  27.    fg_setmode(old_mode);
  28.    fg_reset();
  29.  
  30.    if (read_status == 1)
  31.       printf("CORAL.PCX not found.\n");
  32.    else if (read_status == 2)
  33.       printf("CORAL.PCX is not a PCX file.\n");
  34.    if (write_status == 1)
  35.       printf("NEW.PCX not created.\n");
  36. }
  37.