📄 vcimagedoc.cpp
字号:
// VCIMAGE -- 演示程序
// 华东理工大学信息学院 陆宗骐 编制
// 2003.07.15
// VCImageDoc.cpp : implementation of the CVCImageDoc class
//
#include "stdafx.h"
#include "math.h"
#include "VCImage.h"
#include "VCImageDoc.h"
#include "ImageProcess.h"
#include "CDib_VC.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern char FileName[40];
/////////////////////////////////////////////////////////////////////////////
// CVCImageDoc
IMPLEMENT_DYNCREATE(CVCImageDoc, CDocument)
BEGIN_MESSAGE_MAP(CVCImageDoc, CDocument)
//{{AFX_MSG_MAP(CVCImageDoc)
ON_COMMAND(ID_FILE_SAVE_AS, OnFileSave)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CVCImageDoc construction/destruction
CVCImageDoc::CVCImageDoc()
{
// TODO: add one-time construction code here
}
CVCImageDoc::~CVCImageDoc()
{
}
// SetPathName();
BOOL CVCImageDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CVCImageDoc serialization
void CVCImageDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CVCImageDoc diagnostics
#ifdef _DEBUG
void CVCImageDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CVCImageDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CVCImageDoc commands
BOOL CVCImageDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
m_Process.LoadBmp(lpszPathName);
SetPathName(lpszPathName);
SetModifiedFlag(FALSE); // start off with unmodified
return TRUE;
}
void CVCImageDoc::OnFileSave()
{
static char szFilter[]="BMP Files(*.BMP)|*.BMP||";
CFileDialog FileDlg(NULL,NULL,NULL,OFN_HIDEREADONLY,szFilter);
m_Process.SaveBmp(FileDlg.GetPathName());
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -