char time_str[64];
time_t t = time(0);
strftime(time_str, sizeof(time_str), "%Y.%m.%d %H.%M.%S", localtime(&t));
std::string fileName = getAppPath() + std::string("\\dst_") + time_str + ".bmp";
n_print("file=%s, line=%d,final=%s\n", __FILE__, __LINE__, fileName.c_str());
FILE* fpw = NULL;
if((fpw=fopen(fileName.c_str(),"wb"))==NULL)
{
n_print("create the bmp file error!");
return -999;
}
fwrite(vecImg.data(), vecImg.size(), 1, fpw);
fclose(fpw);
///
code C++保存图片
最新推荐文章于 2024-07-31 15:37:08 发布