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

📄 myimagedoc.cpp

📁 很好的一个 作图程序 对学习这个的很有帮助 希望大家喜欢
💻 CPP
字号:
// MyImageDoc.cpp : implementation of the CMyImageDoc class
//

#include "stdafx.h"
#include "MyImage.h"

#include "MyImageDoc.h"
#include "Picture.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyImageDoc

IMPLEMENT_DYNCREATE(CMyImageDoc, CDocument)

BEGIN_MESSAGE_MAP(CMyImageDoc, CDocument)
	//{{AFX_MSG_MAP(CMyImageDoc)
		// 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
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyImageDoc construction/destruction

CMyImageDoc::CMyImageDoc()
{
	// TODO: add one-time construction code here

}

CMyImageDoc::~CMyImageDoc()
{
}

BOOL CMyImageDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CMyImageDoc serialization

void CMyImageDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CMyImageDoc diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CMyImageDoc commands

BOOL CMyImageDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
	if (!CDocument::OnOpenDocument(lpszPathName))
		return FALSE;
	
	// TODO: Add your specialized creation code here
	
	return pic.LoadPictureFromFile(lpszPathName);
}

BOOL CMyImageDoc::OnSaveDocument(LPCTSTR lpszPathName) 
{
	// TODO: Add your specialized code here and/or call the base class
	return pic.SaveAsBitmap("gg.bmp");
//	pic.m_pPic->SaveAsFile(
//	return CDocument::OnSaveDocument(lpszPathName);
}

⌨️ 快捷键说明

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