vision.cpp
上传用户:zhaobiao
上传日期:2013-10-27
资源大小:92k
文件大小:2k
- // vision.cpp : implementation file
- //
- #include "stdafx.h"
- #include "aa.h"
- #include "vision.h"
- #include "cvapp.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // Cvision dialog
- Cvision::Cvision(CWnd* pParent /*=NULL*/)
- : CDialog(Cvision::IDD, pParent)
- {
- //{{AFX_DATA_INIT(Cvision)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void Cvision::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(Cvision)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(Cvision, CDialog)
- //{{AFX_MSG_MAP(Cvision)
- ON_BN_CLICKED(IDC_BUTTON1, OnOpen)
- ON_BN_CLICKED(IDC_BUTTON2, OnProcess)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // Cvision message handlers
- void Cvision::OnOpen()
- {
- CFileDialog dlg(TRUE, _T("*.bmp"), "",
- OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_HIDEREADONLY,
- "image files (*.bmp; *.jpg) |*.bmp;*.jpg|AVI files (*.avi) |*.avi|All Files (*.*)|*.*||",NULL);
- char title[]= {"Open Image"};
- dlg.m_ofn.lpstrTitle= title;
- if (dlg.DoModal() == IDOK) {
- CString path= dlg.GetPathName();
- if (proc != 0)
- delete proc;
- proc= new ImageProcessor(path);
- }
- }
- void Cvision::OnProcess()
- {
- if (proc != 0) {
- proc->execute();
- proc->display();
- }
-
- }