//---------------------------------------------------------------------------- // Laser Guard Ltd. // Copyright © 2000-2002. All Rights Reserved. // Version 1.0 01/01/2000 // Last modification: 08/10/2003 // PROJECT: // SUBSYSTEM: // FILE: ImageViewWnd.cpp // AUTHOR: Sergey Chizhevskiy // OVERVIEW // ~~~~~~~~ // Source file of ImageViewWnd.cpp //---------------------------------------------------------------------------- #include "stdafx.h" #include "ImageViewWnd.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif CImageViewWnd::CImageViewWnd() { } CImageViewWnd::~CImageViewWnd() { } BEGIN_MESSAGE_MAP(CImageViewWnd, CWnd) //{{AFX_MSG_MAP(CImageViewWnd) ON_WM_PAINT() ON_WM_SIZE() //}}AFX_MSG_MAP END_MESSAGE_MAP() BOOL CImageViewWnd::Create( CWnd* pParentWnd, CRect &rect ) { CString strClassName = ::AfxRegisterWndClass( CS_HREDRAW | CS_VREDRAW, LoadCursor( NULL, IDC_ARROW ), NULL, NULL ); if( !CWnd::Create( strClassName, NULL, WS_CHILD | WS_VISIBLE, rect, pParentWnd, 0 ) ) return FALSE; return TRUE; } void CImageViewWnd::OnPaint() { CPaintDC dc(this); OnDraw( &dc ); } void CImageViewWnd::OnDraw(CDC *pDC) { CRect rect; GetClientRect( &rect ); pDC->BitBlt( 0, 0, rect.Width(), rect.Height(), &m_MemoryDC, 0, 0, SRCCOPY ); } void CImageViewWnd::OnSize( UINT nType, int cx, int cy ) { CWnd::OnSize(nType, cx, cy); m_MemoryDC.Create( cx, cy, RGB(0,0,0) ); } CLgMemoryDC& CImageViewWnd::GetMemoryDC() { return m_MemoryDC; }