dcmemory.cpp

来自「MULTI BORAD 控制」· C++ 代码 · 共 35 行

CPP
35
字号
// DCMemory.cpp: implementation of the CDCMemory class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "multiboard.h"
#include "DCMemory.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CDCMemory::CDCMemory(CDC* pDC, const CRect& rcBounds): CDC()
{
	CreateCompatibleDC(pDC);	
	m_bitmap.CreateCompatibleBitmap(pDC, rcBounds.Width(), rcBounds.Height());
	m_oldBitmap = SelectObject(&m_bitmap);
	m_pDC = pDC;
	m_rcBounds = rcBounds;
}

CDCMemory::~CDCMemory()
{
	m_pDC->BitBlt(m_rcBounds.left, m_rcBounds.top, m_rcBounds.Width(), m_rcBounds.Height(),
		this, m_rcBounds.left, m_rcBounds.top, SRCCOPY);
	SelectObject(m_oldBitmap);
	m_bitmap.DeleteObject();
}

⌨️ 快捷键说明

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