• 大小: 2.58MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-14
  • 语言: C/C++
  • 标签: C++  MFC  OPENCV  

资源简介

利用MFC和OpenCV实现的图片浏览器,支持放大缩小拖拽

资源截图

代码片段和文件信息

// MainFrm.cpp : implementation of the CMainframe class
//

#include “stdafx.h“
#include “PicViewer.h“

#include “MainFrm.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainframe

IMPLEMENT_DYNCREATE(CMainframe CframeWnd)

BEGIN_MESSAGE_MAP(CMainframe CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
// NOTE - the ClassWizard will add and remove mapping macros here.
//    DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

static UINT indicators[] =
{
ID_SEPARATOR           // status line indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};

/////////////////////////////////////////////////////////////////////////////
// CMainframe construction/destruction

CMainframe::CMainframe()
{
// TODO: add member initialization code here

}

CMainframe::~CMainframe()
{
}

int CMainframe::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CframeWnd::OnCreate(lpCreateStruct) == -1)
return -1;

if (!m_wndToolBar.CreateEx(this TBstyle_FLAT WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINframe))
{
TRACE0(“Failed to create toolbar\n“);
return -1;      // fail to create
}

if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators
  sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed to create status bar\n“);
return -1;      // fail to create
}

// TODO: Delete these three lines if you don‘t want the toolbar to
//  be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);

return 0;
}

BOOL CMainframe::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CframeWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
//  the CREATESTRUCT cs

return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CMainframe diagnostics

#ifdef _DEBUG
void CMainframe::AssertValid() const
{
CframeWnd::AssertValid();
}

void CMainframe::Dump(CDumpContext& dc) const
{
CframeWnd::Dump(dc);
}

#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMainframe message handlers


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-07-22 18:50  ImageProcess\
     目录           0  2014-07-22 21:46  ImageProcess\PicViewer\
     目录           0  2014-07-22 21:34  ImageProcess\PicViewer\Debug\
     文件       20092  2014-07-22 21:31  ImageProcess\PicViewer\Debug\MainFrm.obj
     文件      188478  2014-07-22 21:34  ImageProcess\PicViewer\Debug\PicViewer.exe
     文件      346856  2014-07-22 21:34  ImageProcess\PicViewer\Debug\PicViewer.ilk
     文件       23279  2014-07-22 21:31  ImageProcess\PicViewer\Debug\PicViewer.obj
     文件     6121168  2014-07-22 21:31  ImageProcess\PicViewer\Debug\PicViewer.pch
     文件      443392  2014-07-22 21:34  ImageProcess\PicViewer\Debug\PicViewer.pdb
     文件       57576  2014-07-22 21:34  ImageProcess\PicViewer\Debug\PicViewer.res
     文件          79  2014-07-22 20:13  ImageProcess\PicViewer\Debug\PicViewer.SUP
     文件       16970  2014-07-22 21:31  ImageProcess\PicViewer\Debug\PicViewerDoc.obj
     文件       32304  2014-07-22 21:31  ImageProcess\PicViewer\Debug\PicViewerView.obj
     文件      109154  2014-07-22 21:31  ImageProcess\PicViewer\Debug\StdAfx.obj
     文件      230400  2014-07-22 21:45  ImageProcess\PicViewer\Debug\vc60.idb
     文件      397312  2014-07-22 21:31  ImageProcess\PicViewer\Debug\vc60.pdb
     文件        2510  2014-07-22 18:51  ImageProcess\PicViewer\MainFrm.cpp
     文件        1581  2014-07-22 18:51  ImageProcess\PicViewer\MainFrm.h
     文件       94204  2014-07-22 21:34  ImageProcess\PicViewer\PicViewer.aps
     文件        2235  2014-07-22 21:45  ImageProcess\PicViewer\PicViewer.clw
     文件        4263  2014-07-22 18:51  ImageProcess\PicViewer\PicViewer.cpp
     文件        4950  2014-07-22 21:35  ImageProcess\PicViewer\PicViewer.dsp
     文件         541  2014-07-22 18:51  ImageProcess\PicViewer\PicViewer.dsw
     文件        1389  2014-07-22 18:51  ImageProcess\PicViewer\PicViewer.h
     文件       58368  2014-07-22 21:46  ImageProcess\PicViewer\PicViewer.ncb
     文件       50688  2014-07-22 21:46  ImageProcess\PicViewer\PicViewer.opt
     文件         252  2014-07-22 21:45  ImageProcess\PicViewer\PicViewer.plg
     文件         654  2014-07-22 21:46  ImageProcess\PicViewer\PicViewer.positions
     文件       11754  2014-07-22 21:34  ImageProcess\PicViewer\PicViewer.rc
     文件        2057  2014-07-22 19:49  ImageProcess\PicViewer\PicViewerDoc.cpp
     文件        1784  2014-07-22 19:53  ImageProcess\PicViewer\PicViewerDoc.h
............此处省略13个文件信息

评论

共有 条评论