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.7 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: VideoWnd.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of VideoWnd.cpp
  13. //----------------------------------------------------------------------------
  14. // VideoWnd.cpp : implementation file
  15. //
  16. #include "stdafx.h"
  17. #include "VideoWnd.h"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CVideoWnd
  25. CVideoWnd::CVideoWnd()
  26. {
  27. }
  28. CVideoWnd::~CVideoWnd()
  29. {
  30. }
  31. BEGIN_MESSAGE_MAP(CVideoWnd, CWnd)
  32. //{{AFX_MSG_MAP(CVideoWnd)
  33. ON_WM_PAINT()
  34. //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CVideoWnd message handlers
  38. BOOL CVideoWnd::Create(CWnd *pParentWnd, CRect &rect)
  39. {
  40. CString strClassName = ::AfxRegisterWndClass( CS_HREDRAW | CS_VREDRAW, LoadCursor( NULL, IDC_ARROW ), NULL, NULL );
  41. if( !CWnd::Create( strClassName, NULL, WS_CHILD | WS_VISIBLE, rect, pParentWnd, 0 ) )
  42. return FALSE;
  43. return TRUE;
  44. }
  45. void CVideoWnd::OnPaint()
  46. {
  47. CPaintDC dc(this);
  48. CRect rect;
  49. GetClientRect( &rect );
  50. m_VideoDIB.Draw( dc.GetSafeHdc(), &rect );
  51. GetParent()->SendMessage( WM_VIDEO_READY, m_nSequence, m_nSequence );
  52. }
  53. void CVideoWnd::UpdateVideoDIB( CLgImageDIB *pDIB, INT nSequence )
  54. {
  55. m_nSequence = nSequence;
  56. m_VideoDIB.Create( (LPBITMAPINFO)*pDIB, *pDIB );
  57. InvalidateRect( NULL );
  58. }