⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bmpview.cpp

📁 这是《深入浅出MFC》这本书的源代码
💻 CPP
字号:
// BMPView.cpp : implementation file
//

#include "stdafx.h"
#include "Example.h"
#include "BMPView.h"
#include "BMPDocument.h"
#include "DIB.h"

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

/////////////////////////////////////////////////////////////////////////////
// CBMPView

IMPLEMENT_DYNCREATE(CBMPView, CView)

CBMPView::CBMPView()
{
}

CBMPView::~CBMPView()
{
}


BEGIN_MESSAGE_MAP(CBMPView, CView)
	//{{AFX_MSG_MAP(CBMPView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBMPView drawing

void CBMPView::OnDraw(CDC* pDC)
{
	CBMPDocument* pDoc = GetDocument();
	// TODO: add draw code here
    CDib dib; 
	dib.Load(pDoc->GetPathName());
    dib.SetPalette(pDC);
	dib.Draw(pDC);
}

/////////////////////////////////////////////////////////////////////////////
// CBMPView diagnostics

#ifdef _DEBUG
void CBMPView::AssertValid() const
{
	CView::AssertValid();
}

CBMPDocument* CBMPView::GetDocument()
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CBMPDocument)));
	return (CBMPDocument*)m_pDocument;
}
void CBMPView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CBMPView message handlers

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -