testdlg.cpp
来自「一个用于无刷直流电动机的驱动与控制程序.里面所用的采集卡的型号为MC08.」· C++ 代码 · 共 72 行
CPP
72 行
// 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 + =
减小字号Ctrl + -
显示快捷键?