CFileDialog dlgFile(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, _T("All Files (*.*)|*.*|Jpeg Files (*.jpg)|*.jpg|Bmp Files (*.bmp)|*.bmp||"), NULL, 0);
dlgFile.m_ofn.Flags |= OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
if(dlgFile.DoModal()!=IDOK)return;
if(m_pImage!=NULL)
{
if(m_pImage->pBitmap)delete m_pImage->pBitmap;
if(m_pImage->data)delete []m_pImage->data;
delete m_pImage;
}
m_pImage = load_image(dlgFile.GetPathName()); /*图片路径字符串保存在 dlgFile.GetPathName() 中/*
毕设笔记:MFC打开一个图片文件
最新推荐文章于 2018-10-26 10:11:40 发布