📄 intdwtview.cpp
字号:
// INTDWTView.cpp : implementation of the CINTDWTView class
//
#include "stdafx.h"
#include "INTDWT.h"
#include "INTDWTDoc.h"
#include "INTDWTView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CINTDWTView
IMPLEMENT_DYNCREATE(CINTDWTView, CScrollView)
BEGIN_MESSAGE_MAP(CINTDWTView, CScrollView)
//{{AFX_MSG_MAP(CINTDWTView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CScrollView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CINTDWTView construction/destruction
CINTDWTView::CINTDWTView()
{
// TODO: add construction code here
}
CINTDWTView::~CINTDWTView()
{
}
BOOL CINTDWTView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CScrollView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CINTDWTView drawing
void CINTDWTView::OnDraw(CDC* pDC)
{
CINTDWTDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CRect rect1(20,30,20+pDoc->lpSrc.Width(),30+pDoc->lpSrc.Height());
CRect rect2(40+pDoc->lpDst1.Width(),30,40+pDoc->lpDst1.Width()*2,30+pDoc->lpDst1.Height());
CRect rect3(60+pDoc->lpDst1.Width()*2,30,60+pDoc->lpDst2.Width()*3,30+pDoc->lpDst2.Height());
if( pDoc->lpSrc.IsValid())
{
pDoc->lpSrc.Paint(pDC->GetSafeHdc(),rect1);
pDC->DrawText("原始图像",CRect(20,pDoc->lpSrc.Height()+30,
20+pDoc->lpSrc.Width(),pDoc->lpSrc.Height()+50),DT_CENTER);
}
if( pDoc->lpDst1.IsValid())
{
pDoc->lpDst1.Paint(pDC->GetSafeHdc(),rect2);
pDC->DrawText("小波变换后图像",CRect(pDoc->lpDst1.Width()+40,pDoc->lpDst1.Height()+30,
40+pDoc->lpDst1.Width()*2,pDoc->lpDst1.Height()+50),DT_CENTER);
}
if( pDoc->lpDst2.IsValid())
{
pDoc->lpDst2.Paint(pDC->GetSafeHdc(),rect3);
pDC->DrawText("小波反变换后图像",CRect(pDoc->lpDst2.Width()*2+60,pDoc->lpDst2.Height()+30,
60+pDoc->lpDst2.Width()*3,pDoc->lpDst2.Height()+50),DT_CENTER);
}
}
void CINTDWTView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CSize sizeTotal;
// TODO: calculate the total size of this view
sizeTotal.cx = sizeTotal.cy = 2000;
SetScrollSizes(MM_TEXT, sizeTotal);
}
/////////////////////////////////////////////////////////////////////////////
// CINTDWTView printing
BOOL CINTDWTView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CINTDWTView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CINTDWTView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CINTDWTView diagnostics
#ifdef _DEBUG
void CINTDWTView::AssertValid() const
{
CScrollView::AssertValid();
}
void CINTDWTView::Dump(CDumpContext& dc) const
{
CScrollView::Dump(dc);
}
CINTDWTDoc* CINTDWTView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CINTDWTDoc)));
return (CINTDWTDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CINTDWTView message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -