#define OSD_FILEF "/home/OsdSave.txt"
typedef struct textOSD_s
{
int font_size;
int outline;
int bold;
int italic;
int color;
}textOSD_t;
void saveRead()
{
memset(&osd_t,0,sizeof(textOSD_t));
if((osdfp=fopen(OSD_FILE,"wb"))==NULL) //打开一个文件,以二进制向文本中写入
{
printf("can not open file \n");
return;
}
else
{
fwrite(&osd_t,sizeof(textOSD_t),1,osdfp); //写
}
fclose(osdfp); //关闭
if((osdfp=fopen(OSD_FILE,"rb"))==NULL) //打开一个文件。以二进制的方式来读
{
printf("can not open file \n");
return;
}
else
{
fread(&osd_t,sizeof(textOSD_t),1,osdfp); //读
}
fclose(osdfp); //关闭
}