📄 oilview.cpp
字号:
// OILView.cpp : implementation of the COILView class
//
#include "stdafx.h"
#include "OIL.h"
#include "OILDoc.h"
#include "OILView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COILView
IMPLEMENT_DYNCREATE(COILView, CFormView)
BEGIN_MESSAGE_MAP(COILView, CFormView)
//{{AFX_MSG_MAP(COILView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COILView construction/destruction
COILView::COILView()
: CFormView(COILView::IDD)
{
//{{AFX_DATA_INIT(COILView)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// TODO: add construction code here
}
COILView::~COILView()
{
}
void COILView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COILView)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BOOL COILView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CFormView::PreCreateWindow(cs);
}
void COILView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
//加载图片
m_Picture.Load(".\\images\\2.jpg");
//初始化串口
}
/////////////////////////////////////////////////////////////////////////////
// COILView printing
BOOL COILView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void COILView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void COILView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
void COILView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)
{
// TODO: add customized printing code here
}
/////////////////////////////////////////////////////////////////////////////
// COILView diagnostics
#ifdef _DEBUG
void COILView::AssertValid() const
{
CFormView::AssertValid();
}
void COILView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
COILDoc* COILView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(COILDoc)));
return (COILDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// COILView message handlers
void COILView::OnDraw(CDC* pDC)
{
// TODO: Add your specialized code here and/or call the base class
m_Picture.UpdateSizeOnDC(pDC); // Get Picture Dimentions In Pixels
CRect ClientRc;
GetClientRect(&ClientRc);
m_Picture.Show(pDC, CPoint(0,0),CPoint(ClientRc.right, ClientRc.bottom),0,0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -