📄 fullscreenview.cpp
字号:
// FullScreenView.cpp : implementation of the CFullScreenView class
//
#include "stdafx.h"
#include "FullScreen.h"
#include "MainFrm.h"
#include "FullScreenDoc.h"
#include "FullScreenView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFullScreenView
IMPLEMENT_DYNCREATE(CFullScreenView, CView)
BEGIN_MESSAGE_MAP(CFullScreenView, CView)
//{{AFX_MSG_MAP(CFullScreenView)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFullScreenView construction/destruction
CFullScreenView::CFullScreenView()
{
// TODO: add construction code here
}
CFullScreenView::~CFullScreenView()
{
}
BOOL CFullScreenView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CFullScreenView drawing
void CFullScreenView::OnDraw(CDC* pDC)
{
CFullScreenDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
if(GetDocument()->GetPathName()!=" ")
{
HBITMAP bitmap;
bitmap=(HBITMAP)LoadImage(AfxGetInstanceHandle(),
GetDocument()->GetPathName(),IMAGE_BITMAP,0,0,
LR_LOADFROMFILE|LR_CREATEDIBSECTION);
HBITMAP OldBitmap;
CDC MemDC;
MemDC.CreateCompatibleDC(pDC);
CRect rect;
GetClientRect(rect);
OldBitmap=(HBITMAP)MemDC.SelectObject(bitmap);
pDC->BitBlt(0,0,rect.Width(),rect.Height(),&MemDC,0,0,SRCCOPY);
MemDC.SelectObject(OldBitmap);
}
}
/////////////////////////////////////////////////////////////////////////////
// CFullScreenView printing
BOOL CFullScreenView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CFullScreenView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CFullScreenView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CFullScreenView diagnostics
#ifdef _DEBUG
void CFullScreenView::AssertValid() const
{
CView::AssertValid();
}
void CFullScreenView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CFullScreenDoc* CFullScreenView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CFullScreenDoc)));
return (CFullScreenDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFullScreenView message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -