SaveImage(IplImage *img)
{
CFileDialog SaveDlg(FALSE,"bmp","未命名",OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_NOCHANGEDIR,"所有文件
(*.bmp;*.jpg;*.gif;*tiff)|*.bmp;*.jpg;*.gif;*.tiff|BMP(*.bmp)|*.bmp| JPG(*.jpg)|*.jpg| GIF(*.gif)|*.gif| TIFF(*.tiff)|
*.tiff||", NULL);
if(SaveDlg.DoModal() == IDOK)
{
CString tempname = SaveDlg.GetPathName();
CString savePath = (LPCSTR)CString(tempname);
cvSaveImage(savePath,img); //保存图像
tempname.ReleaseBuffer();
MessageBox("文件已成功保存!");
}
}