📄 testdlg.cpp
字号:
// TestDlg.cpp : implementation file
//
#include "stdafx.h"
#include "TestForm.h"
#include "TestDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// TestDlg dialog
TestDlg::TestDlg(CWnd* pParent /*=NULL*/)
: CDialog(TestDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(TestDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void TestDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(TestDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(TestDlg, CDialog)
//{{AFX_MSG_MAP(TestDlg)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// TestDlg message handlers
void TestDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CTestFormApp *pApp=(CTestFormApp *)AfxGetApp();
int hitnumber=pApp->m_nHitNumber;
CRect m_ClientRect;
CDC dcComp;
CBitmap bitmap;
GetClientRect(m_ClientRect);
if (hitnumber==0x010) //试验项目
{
bitmap.LoadBitmap(IDB_TEST);
dcComp.CreateCompatibleDC(&dc);
dcComp.SelectObject(&bitmap);
//BITMAP bmInfo;
//bitmap.GetBitmap(&bmInfo);
//bitmap.GetObject(sizeof(bmInfo),&bmInfo);
//dc.SetStretchBltMode(COLORONCOLOR);
//dc.StretchBlt(0,0,m_ClientRect.Width()-50,m_ClientRect.Height(),&dcComp,0,0,bmInfo.bmWidth,bmInfo.bmHeight,SRCCOPY);
dc.BitBlt(20,0,m_ClientRect.Width(),m_ClientRect.Height(),&dcComp,0,0,SRCCOPY);
}
// Do not call CDialog::OnPaint() for painting messages
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -