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

📄 image1view.cpp

📁 本程序基于Visual C++6.0环境编写
💻 CPP
字号:
// Image1View.cpp : implementation file
//

#include "stdafx.h"
#include "wavelets.h"
#include "Image1View.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CImage1View

IMPLEMENT_DYNCREATE(CImage1View, CView)

CImage1View::CImage1View()
{
}

CImage1View::~CImage1View()
{
}


BEGIN_MESSAGE_MAP(CImage1View, CView)
	//{{AFX_MSG_MAP(CImage1View)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CImage1View drawing

void CImage1View::OnDraw(CDC* pDC)
{
	//CDocument* pDoc = GetDocument();

    CWvltDoc* pDoc =(CWvltDoc*) GetDocument();
     unsigned char*	 pBitmap = pDoc -> m_pTransfered1;

	LPBITMAPINFO lpBitmapInfo = (LPBITMAPINFO)(pBitmap + 14);
	unsigned char* pBitmapData = pBitmap + ((LPBITMAPFILEHEADER)pBitmap)->bfOffBits;
	unsigned long biHeight = ((LPBITMAPINFOHEADER)lpBitmapInfo)->biHeight;
	unsigned long biWidth = ((LPBITMAPINFOHEADER)lpBitmapInfo)->biWidth;

	CRect rect;
	GetClientRect(&rect);
	long originx =0;
	long originy =0;
	if((unsigned long)(rect.Width()) > biWidth)
		originx = (rect.Width() - biWidth)>>1;
	if((unsigned long)(rect.Height()) > biHeight)
		originy = (rect.Height() - biHeight)>>1;
	SetDIBitsToDevice(pDC->m_hDC, originx, originy, biWidth, biHeight, 0, 0, 0, biHeight, pBitmapData, 
							lpBitmapInfo, DIB_RGB_COLORS);


	// TODO: add draw code here
}

/////////////////////////////////////////////////////////////////////////////
// CImage1View diagnostics

#ifdef _DEBUG
void CImage1View::AssertValid() const
{
	CView::AssertValid();
}

void CImage1View::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CImage1View message handlers

⌨️ 快捷键说明

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