📄 multdocdoc.cpp
字号:
// MultDocDoc.cpp : implementation of the CMultDocDoc class
//
#include "stdafx.h"
#include "MultDoc.h"
#include "MultDocDoc.h"
#include "MultDocView.h"
#include "dib.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMultDocDoc
IMPLEMENT_DYNCREATE(CMultDocDoc, CDocument)
BEGIN_MESSAGE_MAP(CMultDocDoc, CDocument)
//{{AFX_MSG_MAP(CMultDocDoc)
ON_COMMAND(ID_FILE_MULTOPEN, OnFileMultopen)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMultDocDoc construction/destruction
CMultDocDoc::CMultDocDoc()
{
// TODO: add one-time construction code here
}
CMultDocDoc::~CMultDocDoc()
{
}
BOOL CMultDocDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMultDocDoc serialization
void CMultDocDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CMultDocDoc diagnostics
#ifdef _DEBUG
void CMultDocDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CMultDocDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMultDocDoc commands
// show mult bmp file,e.g. file_c0,file_c1,file_c2,file_c3,file_c4 .....;
BOOL CMultDocDoc::OnFileMultopen()
{
/* CString newName;
CDocManager * pDocManager = AfxGetApp()->m_pDocManager;
CFileDialog opendia(true,NULL,NULL,OFN_HIDEREADONLY,"rip file(*.prn)|*.prn||",NULL);
opendia.m_ofn.lpstrInitialDir="d:\\imageresource\\rip\\";
if(opendia.DoModal()==IDOK)
{
CString str;
CRip rip;
str=opendia.GetPathName();
if(!rip.LoadRipFile(LPCSTR(str)))
return false;
rip.SetPass(3);//set pass to 3 ;
rip.Initmemory();
CMultDocDoc* pNewDoc[20] = {NULL};
for(DWORD i=0;i<rip.count;i++)
{
rip.SendToMemory(i);
CString string1,string2;
/////////// get strc filename ////////
string2=(rip.strs).Left((rip.strs).GetLength()-4);
string2=string2+"_c.bmp";
string1.Format("%d",i);
int x=string2.GetLength();
//int iExtensionPosition = newName.FindOneOf(".");//other one way;
string2.Insert((x-4),(LPCTSTR)string1); // get trip's filename;
pNewDoc[i] = (CMultDocDoc* )(pDocManager->OpenDocumentFile(string2));
POSITION vpos=pNewDoc[i]->GetFirstViewPosition();
CMultDocView* view=(CMultDocView*)pNewDoc[i]->GetNextView(vpos);
CDC* cdc=view->GetDC();
CDib bmp;
bmp.LoadDIB(string2);
RECT client;
view->GetClientRect(&client);
bmp.PaintDIB(cdc->GetSafeHdc(),&client,NULL);
}
}
*/
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -