📄 bgwnd.cpp
字号:
// BGWnd.cpp : implementation file
//
#include "stdafx.h"
#include "resourceeditor.h"
#include "BGWnd.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBGWnd
CBGWnd::CBGWnd()
{
}
CBGWnd::~CBGWnd()
{
}
BEGIN_MESSAGE_MAP(CBGWnd, CWnd)
//{{AFX_MSG_MAP(CBGWnd)
ON_WM_PAINT()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBGWnd message handlers
void CBGWnd::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CBitmap bmpTrade;
VERIFY( bmpTrade.LoadBitmap(IDB_TRADEMARK) );
BITMAP bmpInfo;
VERIFY( bmpTrade.GetBitmap(&bmpInfo) );
CRect rcClient;
GetClientRect(rcClient);
CDC memDC;
VERIFY( memDC.CreateCompatibleDC(&dc) );
CBitmap * pOld = memDC.SelectObject(&bmpTrade);
int x = rcClient.right - bmpInfo.bmWidth - 16;
int y = rcClient.bottom - bmpInfo.bmHeight - 16;
if( x < 0 ) x = 0;
if( y < 0 ) y = 0;
dc.BitBlt(x, y, bmpInfo.bmWidth, bmpInfo.bmHeight, &memDC, 0, 0, SRCCOPY);
memDC.SelectObject(pOld);
memDC.DeleteDC();
// Do not call CWnd::OnPaint() for painting messages
}
void CBGWnd::OnSize(UINT nType, int cx, int cy)
{
CWnd::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
Invalidate();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -