资源描述:
《MFC—OENCV读取图像文件.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、//myImageDlg.cpp:实º¦Ì现?文?件t//#include"stdafx.h"#include"myImage.h"#include"myImageDlg.h"#include"afxdialogex.h"#include"cv.h"//OpenCV头ª¡¤文?件t#include"highgui.h"#include"CvvImage.h"#ifdef_DEBUG#definenewDEBUG_NEW#endif//用®?于®¨²应®
2、用®?程¨¬序¨°“¡ã关?于®¨²”¡À菜?单Ì£¤项?的Ì?CAboutDlg对?话¡ã框¨°classC
3、AboutDlg:publicCDialogEx{public:CAboutDlg();//对?话¡ã框¨°数ºy据Yenum{IDD=IDD_ABOUTBOX};protected:virtualvoidDoDataExchange(CDataExchange*pDX);//DDX/DDV支¡ì持?//实º¦Ì现?protected:DECLARE_MESSAGE_MAP()};CAboutDlg::CAboutDlg():CDialogEx(CAboutDlg::IDD){}voidCAboutDlg::DoDataExchange(CDataExchang
4、e*pDX){CDialogEx::DoDataExchange(pDX);}BEGIN_MESSAGE_MAP(CAboutDlg,CDialogEx)END_MESSAGE_MAP()//CmyImageDlg对?话¡ã框¨°CmyImageDlg::CmyImageDlg(CWnd*pParent/*=NULL*/):CDialogEx(CmyImageDlg::IDD,pParent){m_hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);m_hBmp=NULL;m_pBmpData=NULL;}voidCmyImag
5、eDlg::DoDataExchange(CDataExchange*pDX){CDialogEx::DoDataExchange(pDX);DDX_Control(pDX,IDC_SRC,m_pic_src);DDX_Control(pDX,IDC_DST,m_pic_dst);DDX_Control(pDX,IDC_EDIT1,m_Edt);}BEGIN_MESSAGE_MAP(CmyImageDlg,CDialogEx)ON_WM_SYSCOMMAND()ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_BN_CLICKED(IDC
6、_BUTTON1,&CmyImageDlg::OnBnClickedButton1)ON_STN_CLICKED(IDC_DST,&CmyImageDlg::OnStnClickedDst)ON_BN_CLICKED(IDC_BUTTON2,&CmyImageDlg::OnBnClickedButton2)ON_BN_CLICKED(IDC_BUTTON3,&CmyImageDlg::OnBnClickedButton3)ON_BN_CLICKED(IDC_BUTTON4,&CmyImageDlg::OnBnClickedButton4)END_MESSAGE_
7、MAP()//CmyImageDlg消?息¡é处ä
8、理¤¨ª程¨¬序¨°BOOLCmyImageDlg::OnInitDialog(){CDialogEx::OnInitDialog();//将?“¡ã关?于®¨²...”¡À菜?单Ì£¤项?添¬¨ª加¨®到Ì?系¦Ì统ª3菜?单Ì£¤中D。¡ê//IDM_ABOUTBOX必À?须?在¨²系¦Ì统ª3命¨¹令¢?范¤?围¡ì内¨²。¡êASSERT((IDM_ABOUTBOX&0xFFF0)==IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX<0xF000);CMenu*pSysMenu=Get
9、SystemMenu(FALSE);if(pSysMenu!=NULL){BOOLbNameValid;CStringstrAboutMenu;bNameValid=strAboutMenu.LoadString(IDS_ABOUTBOX);ASSERT(bNameValid);if(!strAboutMenu.IsEmpty()){pSysMenu->AppendMenu(MF_SEPARATOR);pSysMenu->AppendMenu(MF_STRING,IDM_ABOUTBOX,strAboutMenu);}}//设¦¨¨置?此ä?对?话¡ã框¨°的Ì
10、?图ª?标À¨º。¡ê当