LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
bitmapconverter.c
Go to the documentation of this file.
1 #include <stdio.h>
2 
3 #define ULONG unsigned int
4 #define UBYTE unsigned char
5 
6 #include "bitmap.bmp"
7 
8 int main(void)
9 {
10  FILE *pFile;
11  ULONG FileSize;
12  ULONG *pFileSize;
13  UBYTE Header[2];
14  char BmpNameBuf[255];
15  char BmpNamePath[255];
16  getcwd(BmpNamePath,250);
17 
18  snprintf(BmpNameBuf,255,"bitmap.rgf");
19  pFile = fopen (BmpNameBuf,"wb");
20  if (pFile != NULL)
21  {
22  FileSize = sizeof(bitmap_bits);
23  Header[0] = bitmap_width;
24  Header[1] = bitmap_height;
25  fwrite (Header,1,2,pFile);
26  fwrite (bitmap_bits,1,FileSize,pFile);
27  fclose (pFile);
28  }
29  else
30  {
31  printf("\r\nBitmap file not created !!!!!\r\n");
32  }
33 
34  return (0);
35 }
#define snprintf
Definition: c_input.c:141
unsigned int ULONG
Basic Type used to symbolise 32 bit unsigned values.
Definition: lmstypes.h:31
unsigned char UBYTE
Basic Type used to symbolise 8 bit unsigned values.
Definition: lmstypes.h:29
int main(void)
#define NULL