void COpenCVInterfaceDlg::OnFileOpen32771() { CFileDialog fOpenDlg(TRUE, "bmp", "", OFN_HIDEREADONLY|OFN_FILEMUSTEXIST, "Bitmap Files (*.bmp)|*.bmp||", NULL); CFile m_dataFile; if(fOpenDlg.DoModal()==IDOK) { CString s=fOpenDlg.GetPathName(); PSTR szFileName=strdup(s); //IplImage* img = cvLoadImage(szFileName); Mat temp; //temp=imread(szFileName,CV_LOAD_IMAGE_ANYDEPTH |CV_LOAD_IMAGE_COLOR); //temp=imread(szFileName,CV_LOAD_IMAGE_UNCHANGED); temp=imread(szFileName,CV_LOAD_IMAGE_GRAYSCALE); if(temp.cols>0) { mainImage=temp; ResetImageBrush(); Invalidate(); } else AfxMessageBox("error in opening file"); } }
void CPlayMp3Dlg::OnBnClickedBtnBrowse() { CFileDialog fOpenDlg( TRUE, _T("mp3"), _T("*.mp3"), OFN_HIDEREADONLY|OFN_FILEMUSTEXIST, _T("MP3 files (*.mp3)|*.mp3|All files (*.*)|*.*||"), this); fOpenDlg.m_pOFN->lpstrTitle=_T("MP3 file"); CString szMkvPath; if(fOpenDlg.DoModal()==IDOK) { szMkvPath = fOpenDlg.GetPathName(); m_edtMp3File.SetWindowText(szMkvPath); } }
void controlDialog::OnBnClicked1LoadMesh() { CFileDialog fOpenDlg(TRUE, _T("stl"), _T("Load mesh file"), OFN_HIDEREADONLY|OFN_FILEMUSTEXIST, _T("STL file (*.stl)|*.stl||"), this); fOpenDlg.m_pOFN->lpstrTitle=_T("Load mesh file"); if(fOpenDlg.DoModal()==IDOK) { CString path = (LPCTSTR)fOpenDlg.GetPathName(); TRACE(path); // Do something useful here } changeToState(STATE_1_GEN_VOXEL); }