⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bmpviewerview.cpp

📁 本实例主要展示图像处理的功能
💻 CPP
字号:
// BMPViewerView.cpp : implementation of the CBMPViewerView class//#include "stdafx.h"#include "BMPViewer.h"#include "BMPViewerDoc.h"#include "BMPViewerView.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CBMPViewerViewIMPLEMENT_DYNCREATE(CBMPViewerView, CView)BEGIN_MESSAGE_MAP(CBMPViewerView, CView)	//{{AFX_MSG_MAP(CBMPViewerView)	ON_WM_PAINT()	//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CBMPViewerView construction/destructionCBMPViewerView::CBMPViewerView(){	// TODO: add construction code here}CBMPViewerView::~CBMPViewerView(){}BOOL CBMPViewerView::PreCreateWindow(CREATESTRUCT& cs){	// TODO: Modify the Window class or styles here by modifying	//  the CREATESTRUCT cs	return CView::PreCreateWindow(cs);}/////////////////////////////////////////////////////////////////////////////// CBMPViewerView drawingvoid CBMPViewerView::OnDraw(CDC* pDC){	CBMPViewerDoc* pDoc = GetDocument();	ASSERT_VALID(pDoc);	// TODO: add draw code for native data here}/////////////////////////////////////////////////////////////////////////////// CBMPViewerView diagnostics#ifdef _DEBUGvoid CBMPViewerView::AssertValid() const{	CView::AssertValid();}void CBMPViewerView::Dump(CDumpContext& dc) const{	CView::Dump(dc);}CBMPViewerDoc* CBMPViewerView::GetDocument() // non-debug version is inline{	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CBMPViewerDoc)));	return (CBMPViewerDoc*)m_pDocument;}#endif //_DEBUG/////////////////////////////////////////////////////////////////////////////// CBMPViewerView message handlersvoid CBMPViewerView::OnPaint() {	CPaintDC dc(this); // device context for painting		// TODO: Add your message handler code here
		//得到文档指针	CBMPViewerDoc* pDoc = GetDocument();	ASSERT_VALID(pDoc);
	//是否已打开某个BMP文件	if(pDoc->flag==1)	{		//指定是显示的颜色
		SetDIBitsToDevice(dc.m_hDC,0,0,pDoc->pbi->bmiHeader.biWidth,			pDoc->pbi->bmiHeader.biHeight,0,0,0,			pDoc->pbi->bmiHeader.biHeight,pDoc->lpshowbuf, 			pDoc->pbi,DIB_RGB_COLORS);   	}	// Do not call CView::OnPaint() for painting messages}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -