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.

65 lines
1.9 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: VideoFrameGrabberWnd.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of VideoFrameGrabberWnd.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __VIDEO__FRAME__GRABBER__WND__H__INCLUDED__
  15. #define __VIDEO__FRAME__GRABBER__WND__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include "VideoWnd.h"
  20. class CVideoFrameGrabberWnd : public CVideoWnd
  21. {
  22. public:
  23. CVideoFrameGrabberWnd();
  24. virtual ~CVideoFrameGrabberWnd();
  25. public:
  26. virtual BOOL Create( HWND, LPPOINT pPoint = NULL, LPSIZE pSize = NULL );
  27. virtual void UpdatePositions();
  28. virtual HWND GetSafeHwnd();
  29. virtual BOOL ShowWindow( int nShow );
  30. virtual bool IsNeedUpdateFrame() { return ::IsWindowVisible( m_hFrameGrabberWnd ) == TRUE; }
  31. virtual void UpdateFrame();
  32. public:
  33. virtual HBITMAP StoreImage( HANDLE, LPCTSTR, INT nBitCount );
  34. virtual HBITMAP GetSnapshot();
  35. protected:
  36. static LRESULT CALLBACK WindowProc_( HWND, UINT, WPARAM, LPARAM );
  37. protected:
  38. enum{ IMAGE_WIDTH = 320, IMAGE_HEIGHT = 240 };
  39. // enum{ IMAGE_WIDTH = 384, IMAGE_HEIGHT = 288 };
  40. // enum{ IMAGE_WIDTH = 192, IMAGE_HEIGHT = 144 };
  41. void Snapshot();
  42. void Draw( HDC );
  43. protected:
  44. LRESULT OnTimer( HWND, WPARAM, LPARAM );
  45. LRESULT OnPaint( HWND, WPARAM, LPARAM );
  46. LRESULT WindowProc( HWND, UINT, WPARAM, LPARAM );
  47. protected:
  48. void InitSnapshot();
  49. HWND m_hFrameGrabberWnd;
  50. HDC m_hFrameGrabberMemDC;
  51. HBITMAP m_hFrameGrabberMemBitmap;
  52. LPBYTE m_pFrameGrabberBuffer;
  53. LPBITMAPINFO m_pFrameGrabberBmi;
  54. CRITICAL_SECTION m_CriticalSection;
  55. };
  56. #endif