Next button (accelerator) in MFC with opencv

  • Thread starter Thread starter sector_0000
  • Start date Start date
S

sector_0000

Guest
Hello everyone,

I am writing an application in which I use C++ MFC with OpenCv 2.0, dialog based. In this app I have to upload the image from some destination in my computer and when I press (for example) pg dn button must open a next image which is located in this folder that I selected. For this purpose I use accelerator. I dont know how to open next image. Can anyone help? This is .cpp file in which I open the image:

void CProject1Dlg::OnImageOpen()
{
CFileDialog dlg(TRUE, _T("*.bmp"), "", OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_HIDEREADONLY,
"Image files (*.bmp; *.jpg; *.pgm; *.png) |*.bmp;*.jpg;*.pgm;*.png |All Files (*.*)|*.*||",NULL);
dlg.m_ofn.lpstrTitle = _T("Select Image");
if (dlg.DoModal() == IDOK)
{
CString path = dlg.GetPathName();
IplImage *image;
image = cvLoadImage(path);
cvNamedWindow("Original image",0);
cvResizeWindow("Original image",1024,768);
cvShowImage("Original image", image);
cvReleaseImage(&image);
}
}



void CProject1Dlg::OnAccNextImage() //This is accelerator
{

// TODO: Add your control notification handler code here


}

Continue reading...
 
Back
Top