內存數據寫到本地

 DWORD           dwPictureLen;			//圖片大小
 char*           pPicBuffer;        	//圖片數據, 

string file_path = "D:\\12.jpg";
std::ofstream out_file(file_path.c_str(), ios::out | ios::binary | ios::trunc);
if (!out_file)
{
	return ;
}
if (!out_file.write(pPic->pPicBuffer, pPic->dwPictureLen))
{
	return ;
}
if (out_file.is_open())
{
	out_file.close();
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章