jpegview.cpp

来自「《医学图象的远程传输系统》」· C++ 代码 · 共 89 行

CPP
89 行
字号
// JpegView.cpp : implementation file
//

#include "stdafx.h"
#include "JpegQualityTest.h"
#include "JpegQualityTestDoc.h"
#include "JpegView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CJpegView

IMPLEMENT_DYNCREATE(CJpegView, CScrollView)

CJpegView::CJpegView()
{
}

CJpegView::~CJpegView()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// CJpegView drawing

void CJpegView::OnInitialUpdate()
{
	CScrollView::OnInitialUpdate();
	CJpegQualityTestDoc* pDoc=GetDocument();
	ASSERT_VALID(pDoc);
	SetScrollSizes(MM_TEXT,CSize(pDoc->m_bmInfo.bmiHeader.biWidth,pDoc->m_bmInfo.bmiHeader.biHeight));
}

void CJpegView::OnDraw(CDC* pDC)
{
	CJpegQualityTestDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if (pDoc->m_bmInfo.bmiHeader.biWidth>0 && pDoc->m_bmInfo.bmiHeader.biHeight>0){
		::SetDIBitsToDevice(pDC->m_hDC,
			0,
			0,
			pDoc->m_bmInfo.bmiHeader.biWidth,
			pDoc->m_bmInfo.bmiHeader.biHeight,
			0,
			0,
			0,
			pDoc->m_bmInfo.bmiHeader.biHeight,
			pDoc->m_pDib,
			&pDoc->m_bmInfo,
			DIB_RGB_COLORS);
	}
}

/////////////////////////////////////////////////////////////////////////////
// CJpegView diagnostics

#ifdef _DEBUG
void CJpegView::AssertValid() const
{
	CScrollView::AssertValid();
}

void CJpegView::Dump(CDumpContext& dc) const
{
	CScrollView::Dump(dc);
}

CJpegQualityTestDoc* CJpegView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CJpegQualityTestDoc)));
	return (CJpegQualityTestDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CJpegView message handlers

⌨️ 快捷键说明

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