Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.6 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: ImageViewWnd.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of ImageViewWnd.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "ImageViewWnd.h"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. CImageViewWnd::CImageViewWnd()
  22. {
  23. }
  24. CImageViewWnd::~CImageViewWnd()
  25. {
  26. }
  27. BEGIN_MESSAGE_MAP(CImageViewWnd, CWnd)
  28. //{{AFX_MSG_MAP(CImageViewWnd)
  29. ON_WM_PAINT()
  30. ON_WM_SIZE()
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. BOOL CImageViewWnd::Create( CWnd* pParentWnd, CRect &rect )
  34. {
  35. CString strClassName = ::AfxRegisterWndClass( CS_HREDRAW | CS_VREDRAW, LoadCursor( NULL, IDC_ARROW ), NULL, NULL );
  36. if( !CWnd::Create( strClassName, NULL, WS_CHILD | WS_VISIBLE, rect, pParentWnd, 0 ) )
  37. return FALSE;
  38. return TRUE;
  39. }
  40. void CImageViewWnd::OnPaint()
  41. {
  42. CPaintDC dc(this);
  43. OnDraw( &dc );
  44. }
  45. void CImageViewWnd::OnDraw(CDC *pDC)
  46. {
  47. CRect rect;
  48. GetClientRect( &rect );
  49. pDC->BitBlt( 0, 0, rect.Width(), rect.Height(), &m_MemoryDC, 0, 0, SRCCOPY );
  50. }
  51. void CImageViewWnd::OnSize( UINT nType, int cx, int cy )
  52. {
  53. CWnd::OnSize(nType, cx, cy);
  54. m_MemoryDC.Create( cx, cy, RGB(0,0,0) );
  55. }
  56. CLgMemoryDC& CImageViewWnd::GetMemoryDC()
  57. {
  58. return m_MemoryDC;
  59. }