📄 bkgroundmapview.cpp
字号:
// BkGroundMapView.cpp : CBkGroundMapView 类的实现
//
#include "stdafx.h"
#include "BkGroundMap.h"
#include "BkGroundMapDoc.h"
#include "BkGroundMapView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CBkGroundMapView
IMPLEMENT_DYNCREATE(CBkGroundMapView, CView)
BEGIN_MESSAGE_MAP(CBkGroundMapView, CView)
// 标准打印命令
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
// CBkGroundMapView 构造/销毁
CBkGroundMapView::CBkGroundMapView()
{
// TODO: 在此处添加构造代码
}
CBkGroundMapView::~CBkGroundMapView()
{
}
BOOL CBkGroundMapView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或
// 样式
return CView::PreCreateWindow(cs);
}
// CBkGroundMapView 绘制
void CBkGroundMapView::OnDraw(CDC* pDC)
{
CBkGroundMapDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: 在此处为本机数据添加绘制代码
//创建CBitmap类的对象
CBitmap Bitmap;
//添加位图资源
Bitmap.LoadBitmap(IDB_BITMAP1);
CDC MemDC;
MemDC.CreateCompatibleDC(pDC);
//装入Bitmap对象
CBitmap *pOldBitmap=MemDC.SelectObject(&Bitmap);
BITMAP bmap;
Bitmap.GetObject(sizeof(BITMAP),&bmap);
//显示位图
pDC->BitBlt(0,0,bmap.bmWidth,bmap.bmHeight,&MemDC,0,0,SRCCOPY);
MemDC.SelectObject(pOldBitmap);
}
// CBkGroundMapView 打印
BOOL CBkGroundMapView::OnPreparePrinting(CPrintInfo* pInfo)
{
// 默认准备
return DoPreparePrinting(pInfo);
}
void CBkGroundMapView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 打印前添加额外的初始化
}
void CBkGroundMapView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 打印后添加清除过程
}
// CBkGroundMapView 诊断
#ifdef _DEBUG
void CBkGroundMapView::AssertValid() const
{
CView::AssertValid();
}
void CBkGroundMapView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CBkGroundMapDoc* CBkGroundMapView::GetDocument() const // 非调试版本是内联的
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CBkGroundMapDoc)));
return (CBkGroundMapDoc*)m_pDocument;
}
#endif //_DEBUG
// CBkGroundMapView 消息处理程序
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -