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

📄 jpegview.cpp

📁 《医学图象的远程传输系统》
💻 CPP
字号:
// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -