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

📄 formviewinit.cpp

📁 图书管理系统 带源码 文档
💻 CPP
字号:
// FormViewInit.cpp : implementation file
//

#include "stdafx.h"
#include "Library.h"
#include "FormViewInit.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

///////////////////////////////////////////////////////////////////////////
// CFormViewInit

IMPLEMENT_DYNCREATE(CFormViewInit, CFormView)

CFormViewInit::CFormViewInit()
	: CFormView(CFormViewInit::IDD)
{
	//{{AFX_DATA_INIT(CFormViewInit)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}

CFormViewInit::~CFormViewInit()
{
}

void CFormViewInit::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFormViewInit)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFormViewInit, CFormView)
	//{{AFX_MSG_MAP(CFormViewInit)
	ON_WM_ERASEBKGND()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFormViewInit diagnostics

#ifdef _DEBUG
void CFormViewInit::AssertValid() const
{
	CFormView::AssertValid();
}

void CFormViewInit::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CFormViewInit message handlers

BOOL CFormViewInit::OnEraseBkgnd(CDC* pDC) 
{
	// TODO: Add your message handler code here and/or call default
	CBitmap bitmap;        
	bitmap.LoadBitmap(IDB_BMP_BG);       //取出位图资源

	BITMAP bmp;
	bitmap.GetBitmap(&bmp);

	CDC dcCompatible;
	dcCompatible.CreateCompatibleDC(pDC);   //建立与显示设备兼容的内存设备场境
    dcCompatible.SelectObject(&bitmap);     //将位图选入内存场境
  
	CRect rect;
	GetClientRect(&rect);             
	//pDC->BitBlt(0,0,rect.Width(),rect.Height(),&dcCompatible,0,0,SRCCOPY);
	pDC->StretchBlt(0,0,rect.Width(),rect.Height(),&dcCompatible,
		0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); //显示它
	return TRUE;
	//return CFormView::OnEraseBkgnd(pDC);
}

⌨️ 快捷键说明

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