home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <io.h>
- #include <stdlib.h>
-
- main()
- {
- FILE *fopen(), *input, *output;
- char infilename[30], outfilename[30];
- long int i, j, filelength(), len, position;
- char c;
- int header = 778;
- unsigned int width, height;
-
-
- printf("\n Enter the input filename ");
- gets(infilename);
- printf("\n Enter the output filename ");
- gets(outfilename);
-
- input = fopen(infilename, "rb");
- output = fopen(outfilename, "wb");
-
- len = filelength( fileno(input) );
- len-=header;
- len/=4;
- printf("filesize:%d", len);
-
- for (i=0; i<header; i++)
- {
- c = fgetc(input);
- fputc(c, output);
- }
-
- for (i=0; i<4; i++)
- {
- rewind(input);
- fseek(input, (header+i), SEEK_SET);
- for (j=len; j>0; j--)
- {
- c=getc(input);
- fputc(c, output);
- fseek(input, 3L, SEEK_CUR);
- }
- }
- fclose(input);
- fclose(output);
- }