bmpdocument.cpp

来自「这是《深入浅出MFC》这本书的源代码」· C++ 代码 · 共 78 行

CPP
78
字号
// BMPDocument.cpp : implementation file
//

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

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

/////////////////////////////////////////////////////////////////////////////
// CBMPDocument

IMPLEMENT_DYNCREATE(CBMPDocument, CDocument)

CBMPDocument::CBMPDocument()
{
}

BOOL CBMPDocument::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;
	return TRUE;
}

CBMPDocument::~CBMPDocument()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// CBMPDocument diagnostics

#ifdef _DEBUG
void CBMPDocument::AssertValid() const
{
	CDocument::AssertValid();
}

void CBMPDocument::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CBMPDocument serialization

void CBMPDocument::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
		CFile *file = ar.GetFile();
		for(int i=0;i<file->GetLength();i++)
		{
			ar >> bmpBit[i];
		}
	}
}

/////////////////////////////////////////////////////////////////////////////
// CBMPDocument commands

⌨️ 快捷键说明

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