📄 transstatic1.cpp
字号:
// TransStatic1.cpp : implementation file
//
#include "stdafx.h"
#include "TransStatic.h"
#include "TransStatic1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTransStatic
CTransStatic::CTransStatic()
{
m_hHdc = ::CreateCompatibleDC(NULL);
}
CTransStatic::~CTransStatic()
{
}
BEGIN_MESSAGE_MAP(CTransStatic, CStatic)
//{{AFX_MSG_MAP(CTransStatic)
ON_WM_PAINT()
// ON_WM_CTLCOLOR_REFLECT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTransStatic message handlers
void CTransStatic::PaintBG(CDC *pDC)
{
DibSection.Load(_T("\\UI\\DefaultTheme\\desk.bmp"));
SelectObject(m_hHdc, DibSection.GetSafeHandle());
CClientDC dc(GetParent());
CRect cltRect, wndRect;
GetClientRect(&cltRect);
GetWindowRect(&wndRect);
GetParent()->ScreenToClient(&wndRect);
::BitBlt(pDC->m_hDC, 0, 0, cltRect.Width(), cltRect.Height(), m_hHdc, wndRect.left, wndRect.top, SRCCOPY);
}
void CTransStatic::OnPaint()
{
CPaintDC dc(this); // device context for painting
CDC *pDC = GetDC();
PaintBG(pDC);
delete pDC;
// TODO: Add your message handler code here
// Do not call CStatic::OnPaint() for painting messages
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -