📄 cstatic.cpp
字号:
// CStatic.cpp : implementation file
//
#include "stdafx.h"
#include "Static.h"
#include "CStatic.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCStatic
CCStatic::CCStatic()
{
}
CCStatic::~CCStatic()
{
}
BEGIN_MESSAGE_MAP(CCStatic, CStatic)
//{{AFX_MSG_MAP(CCStatic)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCStatic message handlers
void CCStatic::OnPaint()
{
// CPaintDC dc(this); // device context for painting
PAINTSTRUCT ps;
CDC* pDC = BeginPaint(&ps);
ASSERT(pDC);
BITMAP bm;
CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
m_bkbmp = new CBitmap();
m_bkbmp->LoadBitmap(IDB_BK);
CBitmap *pBmpOld=(CBitmap *)dcMem.SelectObject(m_bkbmp);
m_bkbmp->GetObject(sizeof(bm),(LPVOID)&bm);
CRect rcClient;
GetClientRect(rcClient);
pDC->BitBlt(0,0,rcClient.right-rcClient.left, rcClient.bottom-rcClient.top,&dcMem, 0,0,SRCCOPY);
dcMem.SelectObject(pBmpOld);
pDC->SetBkMode(TRANSPARENT);
CString strText;
GetWindowText(strText);
pDC->DrawText(strText, rcClient, 0);
m_bkbmp->DeleteObject();
EndPaint(&ps);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -