?? transbmpview.cpp
字號(hào):
// TransBmpView.cpp : implementation of the CTransBmpView class
//
#include "stdafx.h"
#include "TransBmp.h"
#include "TransBmpDoc.h"
#include "TransBmpView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTransBmpView
IMPLEMENT_DYNCREATE(CTransBmpView, CView)
BEGIN_MESSAGE_MAP(CTransBmpView, CView)
//{{AFX_MSG_MAP(CTransBmpView)
ON_WM_ERASEBKGND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTransBmpView construction/destruction
CTransBmpView::CTransBmpView()
{
// TODO: add construction code here
}
CTransBmpView::~CTransBmpView()
{
}
BOOL CTransBmpView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CTransBmpView drawing
void CTransBmpView::OnDraw(CDC* pDC)
{
CTransBmpDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CTransBmpView diagnostics
#ifdef _DEBUG
void CTransBmpView::AssertValid() const
{
CView::AssertValid();
}
void CTransBmpView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CTransBmpDoc* CTransBmpView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTransBmpDoc)));
return (CTransBmpDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CTransBmpView message handlers
void CTransBmpView::OnInitialUpdate()
{
CView::OnInitialUpdate();
TRACE("顯示BMP\n");
m_dibBackGround.LoadBMP("test.bmp");
m_dibBackGround.Init(GetDC());
}
BOOL CTransBmpView::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
//畫背景
m_dibBackGround.draw(pDC,CPoint(0,0));
/*
CRect rcClient;
GetClientRect(&rcClient);
CBrush brBkGround;
if(rcClient.Height()>m_dibBackGround.m_lHeight)
{ pDC->FillSolidRect(CRect(rcClient.left,rcClient.bottom-m_dibBackGround.m_lHeight,
rcClient.right,rcClient.bottom),RGB(0,0,0));
}
if(rcClient.Width()>m_dibBackGround.m_lWidth)
{ pDC->FillSolidRect(CRect(rcClient.right-m_dibBackGround.m_lWidth,rcClient.top,
rcClient.right,rcClient.bottom),RGB(0,0,0));
}
*/
return TRUE;//CView::OnEraseBkgnd(pDC);
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -