|
25 Years of Programming
An open source source for C, C++, OWL, BASIC, MDB, XLS, DOT, and more... |
Home Projects Up Sitemap Search Blog Forum+Chat About Us Privacy Terms of Use Feedback FAQ Images Services Payments Humor Music |
Adjust the dimensions of a graphic .PIC fileThis was a trivial program written to fix a .PIC file when I accidentally created one with the wrong dimensions. DeSmet C. Heathkit H-100 computer. |
/* adjust.c 11/19/93
Copyright (C)1993 Steven Whitney. Published under the
GNU GPL (General Public License) Version 3, with ABSOLUTELY NO WARRANTY.
Initially published by http://25yearsofprogramming.com.
adjusts (crops) the dimensions of a .PIC file.
I used it when the H89 MBROT program created a file with too many pixels on a row, or too many rows.
You'll probably need to customize it for each use.
*/
#include "stdio.h"
main()
{
FILE *infile, *outfile;
int i;
char buf[641]; /* Size this to hold one line from the source file */
infile = fopen("h891-100.pic","r");
outfile = fopen("outfile.pic","w");
for(i = 0 ; i < 225 ; i++) /* Only process the first 225 lines, for the H100 */
{
fread(buf,1,641,infile); /* read a line of the size H89 created */
fwrite(buf,1,640,outfile); /* just omit the extra chars when writing */
}
closeall();
}
|
|
|
|
|
|
Copyright ©2011 Steven Whitney. Last modified Tue 05/24/2011 12:27:51 -0700. |
||