// needs fstream
char buffer[1174];
char filename[99];
int x,y = 0;
bool is_blank = true;
strcpy(filename,p->name);
strncat(filename,".bmp",5);
ifstream is("template.bmp", ios::binary);
is.read(buffer, 1174);
is.close();
for(y = 0; y < 8; y++)
for(x = 0; x < 12; x++)
{
buffer[1078+y*12+x] = p->banner[((7-y)*12)+x];
if (p->banner[((7-y)*12)+x] != 0)
is_blank = false;
}
if (!is_blank)
{
ofstream os(filename, ios::binary);
os.write(buffer, 1174);
os.close();
}