www.pudn.com > JPGGIF.zip > picturedemoView.cpp


// picturedemoView.cpp : implementation of the CPicturedemoView class 
// 
 
#include "stdafx.h" 
#include "picturedemo.h" 
 
#include "picturedemoDoc.h" 
#include "picturedemoView.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CPicturedemoView 
 
IMPLEMENT_DYNCREATE(CPicturedemoView, CView) 
 
BEGIN_MESSAGE_MAP(CPicturedemoView, CView) 
	//{{AFX_MSG_MAP(CPicturedemoView) 
		// 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 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CPicturedemoView construction/destruction 
 
CPicturedemoView::CPicturedemoView() 
{ 
	// TODO: add construction code here 
 
	// using a resource bitmap 
	m_pict.Load( AfxGetResourceHandle(), IDB_BITMAP_JPEG); 
 
	// using a file 
	//m_pict.Load( "E:\\images\\images4\\0003img.jpg" ); 
 
} 
 
CPicturedemoView::~CPicturedemoView() 
{ 
} 
 
BOOL CPicturedemoView::PreCreateWindow(CREATESTRUCT& cs) 
{ 
	// TODO: Modify the Window class or styles here by modifying 
	//  the CREATESTRUCT cs 
 
	return CView::PreCreateWindow(cs); 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CPicturedemoView drawing 
 
void CPicturedemoView::OnDraw(CDC* pDC) 
{ 
	CPicturedemoDoc* pDoc = GetDocument(); 
	ASSERT_VALID(pDoc); 
	// TODO: add draw code for native data here 
 
	CRect rect; 
	GetClientRect(&rect); 
 
	m_pict.Render( pDC->GetSafeHdc(), &rect); 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CPicturedemoView diagnostics 
 
#ifdef _DEBUG 
void CPicturedemoView::AssertValid() const 
{ 
	CView::AssertValid(); 
} 
 
void CPicturedemoView::Dump(CDumpContext& dc) const 
{ 
	CView::Dump(dc); 
} 
 
CPicturedemoDoc* CPicturedemoView::GetDocument() // non-debug version is inline 
{ 
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPicturedemoDoc))); 
	return (CPicturedemoDoc*)m_pDocument; 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CPicturedemoView message handlers