/* ** blankbmp.c - Program to generate a blank 96 x 48 pixel 1-bit BMP file ** ** File created: 6/26/2000 ** Last revision: 8/10/2000 ** ** Copyright (C) 2000 Sean R. Wells ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** */ #include int main () { FILE *outfile; int i; int bmp_header[70] = { 0x42, 0x4d, /* BM - Indicates bmp */ 0x7a, 0x02, 0x00, 0x00, /* Size of file (in bytes) */ 0x00, 0x00, 0x00, 0x00, /* Reserved */ 0x3e, 0x00, 0x00, 0x00, /* Offset to bmp data */ 0x28, 0x00, 0x00, 0x00, /* Length of header */ 0x60, 0x00, 0x00, 0x00, /* Width (in pixels) */ 0x30, 0x00, 0x00, 0x00, /* Height (in pixels) */ 0x01, 0x00, /* Planes */ 0x01, 0x00, /* Bits per pixel */ 0x00, 0x00, 0x00, 0x00, /* Compression */ 0x40, 0x02, 0x00, 0x00, /* Side of data (in bytes) */ 0x00, 0x00, 0x00, 0x00, /* Horizontal resolution */ 0x00, 0x00, 0x00, 0x00, /* Vertical resolution */ 0x00, 0x00, 0x00, 0x00, /* Colors */ 0x00, 0x00, 0x00, 0x00, /* Important colors */ 0x00, 0x00, 0x00, 0x00, /* Palette (black) */ 0xff, 0xff, 0xff, 0xff /* Palette (white) */ }; int bmp_header_len = 62; int bmp_data_len = 576; printf ( "blanklyr version 1.0b Copyright (C) Sean R. Wells\n" ); printf ( "Generating 'blanklyr.bmp'...\n" ); outfile = fopen ( "blanklyr.bmp", "wb" ); if ( !outfile ) { fprintf ( stderr, "ERROR - Could not open outfile file\n" ); return ( 0 ); } for ( i = 0; i < bmp_header_len; i++ ) { fprintf ( outfile, "%c", ( char ) bmp_header[i] ); } for ( i = 0; i < bmp_data_len; i++ ) { fprintf ( outfile, "%c", ( char ) 0xff ); } fclose ( outfile ); printf ( "Done.\n" ); return ( 0 ); }