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

📄 transbmpview.cpp

📁 嵌入式LINUX9应用程序开发详解中网络编程实例
💻 CPP
字号:
// 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);
}

⌨️ 快捷键说明

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