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

📄 rwjpegexpview.cpp

📁 该程序实现了jpeg编码。开发平台:Window XP
💻 CPP
字号:
// RWJpegExpView.cpp : implementation of the CRWJpegExpView class
//

#include "stdafx.h"
#include "RWJpegExp.h"
#include"MainFrm.h"
#include "RWJpegExpDoc.h"
#include "RWJpegExpView.h"
#include"Dib.h"

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

/////////////////////////////////////////////////////////////////////////////
// CRWJpegExpView

IMPLEMENT_DYNCREATE(CRWJpegExpView, CScrollView)

BEGIN_MESSAGE_MAP(CRWJpegExpView, CScrollView)
	//{{AFX_MSG_MAP(CRWJpegExpView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CScrollView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CScrollView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRWJpegExpView construction/destruction

CRWJpegExpView::CRWJpegExpView()
{
	// TODO: add construction code here

}

CRWJpegExpView::~CRWJpegExpView()
{
}

BOOL CRWJpegExpView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CScrollView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CRWJpegExpView drawing

void CRWJpegExpView::OnDraw(CDC* pDC)
{
	CRWJpegExpDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	if (! pDoc->m_pDib->IsEmpty())
		pDoc->m_pDib->Display(pDC, 0, 0);
}

void CRWJpegExpView::OnInitialUpdate()
{
	CScrollView::OnInitialUpdate();

		CRWJpegExpDoc* pDoc = GetDocument();

	CSize sizeTotal(pDoc->m_pDib->GetWidth(), pDoc->m_pDib->GetHeight());
	SetScrollSizes(MM_TEXT, sizeTotal);
	
	CMainFrame* pAppFrame = (CMainFrame*) AfxGetApp()->m_pMainWnd;
	ASSERT_KINDOF(CMainFrame, pAppFrame);
	CRect rc;
	pAppFrame->GetClientRect(&rc);
	if (rc.Width() >= sizeTotal.cx && rc.Height() >= sizeTotal.cy &&
		(sizeTotal.cx>0 || sizeTotal.cy>0))
		ResizeParentToFit(FALSE);
}

/////////////////////////////////////////////////////////////////////////////
// CRWJpegExpView printing

BOOL CRWJpegExpView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CRWJpegExpView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CRWJpegExpView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CRWJpegExpView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CRWJpegExpView message handlers

⌨️ 快捷键说明

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