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

📄 hsmemdc.cpp

📁 漂亮菜单
💻 CPP
字号:
// HSMemDC.cpp: implementation of the CHSMemDC class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "CHSMenu.h"
#include "HSMemDC.h"

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

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

CHSMemDC::CHSMemDC( CDC* pDC, CRect *prect )
{
	ASSERT( pDC != NULL );

	m_pDC = pDC;

	if ( prect )
		m_rect.CopyRect( prect );
	else
		m_pDC->GetClipBox( &m_rect );

	CreateCompatibleDC( m_pDC );
//	SetMapMode( m_pDC->GetMapMode() );
	m_bmpMem.CreateCompatibleBitmap( m_pDC, m_rect.Width(), m_rect.Height() );
	m_pbmpOld = SelectObject( &m_bmpMem );
//	SetWindowOrg( m_rect.left, m_rect.top );
}

CHSMemDC::CHSMemDC(HDC hDC, RECT *prect )
{
	ASSERT( hDC != NULL );

	m_pDC = CDC::FromHandle( hDC );

	if ( prect )
		m_rect.CopyRect( prect );
	else
		m_pDC->GetClipBox( &m_rect );

	CreateCompatibleDC( m_pDC );
//	SetMapMode( m_pDC->GetMapMode() );
	m_bmpMem.CreateCompatibleBitmap( m_pDC, m_rect.Width(), m_rect.Height() );
	m_pbmpOld = SelectObject( &m_bmpMem );
//	SetWindowOrg( m_rect.left, m_rect.top );
}

CHSMemDC::~CHSMemDC()
{
	m_pDC->BitBlt( m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(), this, 0, 0, SRCCOPY );

	SelectObject( m_pbmpOld );
	m_bmpMem.DeleteObject();
	DeleteDC();
}

⌨️ 快捷键说明

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