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.

61 lines
1.5 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: ImageWnd.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of ImageWnd.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "ImageWnd.h"
  16. #include "..\LgLib\Version.h"
  17. CImageWnd::CImageWnd()
  18. {
  19. }
  20. CImageWnd::~CImageWnd()
  21. {
  22. }
  23. BOOL CImageWnd::Create( HWND hParent, RECT *pRect )
  24. {
  25. LPCTSTR pClassName = _T("LgImageWnd");
  26. HINSTANCE hInstance = (HINSTANCE)::GetWindowLong( hParent, GWL_HINSTANCE );
  27. RegisterClass( pClassName, hInstance );
  28. if( !CGenericWnd::Create( pClassName, NULL, WS_CHILD | WS_VISIBLE, pRect->left, pRect->top, pRect->right - pRect->left, pRect->bottom - pRect->top, hParent, NULL, hInstance ) )
  29. {
  30. return FALSE;
  31. }
  32. return TRUE;
  33. }
  34. LRESULT CImageWnd::OnPaint( WPARAM wParam, LPARAM lParam )
  35. {
  36. PAINTSTRUCT ps;
  37. HDC hDC = BeginPaint( &ps );
  38. RECT rect;
  39. GetClientRect( &rect );
  40. ::BitBlt( hDC, rect.left, rect.top, rect.right, rect.bottom, m_MemoryDC.GetSafeHdc(), 0, 0, SRCCOPY );
  41. EndPaint( &ps );
  42. return TRUE;
  43. }
  44. LRESULT CImageWnd::OnSize( WPARAM wParam, LPARAM lParam )
  45. {
  46. m_MemoryDC.Create( LOWORD(lParam), HIWORD(lParam) );
  47. return TRUE;
  48. }