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

📄 mdiclient.cpp

📁 刚上传内容的相关CODEC不能单独上传。于是
💻 CPP
字号:
// MDIClient.cpp : implementation file
//

#include "stdafx.h"
#include "MagicScissors.h"
#include "MDIClient.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMDIClient

CMDIClient::CMDIClient()
{
}

CMDIClient::~CMDIClient()
{
}


BEGIN_MESSAGE_MAP(CMDIClient, CWnd)
	//{{AFX_MSG_MAP(CMDIClient)
	ON_WM_PAINT()
	ON_WM_ERASEBKGND()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CMDIClient message handlers

void CMDIClient::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here
	
	// Do not call CWnd::OnPaint() for painting messages
}

BOOL CMDIClient::OnEraseBkgnd(CDC* pDC) 
{
	// TODO: Add your message handler code here and/or call default
	if( m_bmBack.m_hObject == NULL )
		m_bmBack.LoadBitmap(IDB_BACK);

	CRect rect;
	GetClientRect(&rect);
	int w = rect.Width();
	int h = rect.Height();
	int dw, dh;
	int i,j;

	CDC MemDC1, MemDC2;
	CBitmap *pBitmap1, *pBitmap2;
	CBitmap bmBack;
	MemDC1.CreateCompatibleDC(pDC);
	MemDC2.CreateCompatibleDC(pDC);
	bmBack.CreateCompatibleBitmap(pDC, rect.Width(), rect.Height());
	pBitmap1 = MemDC1.SelectObject( &m_bmBack );
	pBitmap2 = MemDC2.SelectObject( &bmBack );

	int bw = 200;
	int bh = 112;

	for( j = 0 ; j < h ; j+= bh )
	{
		for( i = 0 ; i < w ; i+= bw )
		{
			if( i+bw <= w )
				dw = bw;
			else dw = w-i;

			if( j+bh <= h )
				dh = bh;
			else dh = h-j;

			MemDC2.BitBlt( i, j, dw, dh, &MemDC1, 0, 0, SRCCOPY );
		}
	}
	pDC->BitBlt(0, 0, w, h, &MemDC2, 0, 0, SRCCOPY );

	MemDC1.SelectObject(pBitmap1);
	MemDC2.SelectObject(pBitmap2);

	return TRUE;	
}

⌨️ 快捷键说明

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