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.

114 lines
2.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: 27/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: LgSubVideoDlg.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of LgSubVideoDlg.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "lglibreport.h"
  16. #include "LgSubVideoDlg.h"
  17. #include "LgReportDlg.h"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. CLgSubVideoDlg::CLgSubVideoDlg(CWnd* pParent /*=NULL*/)
  24. : CDialog(CLgSubVideoDlg::IDD, pParent)
  25. {
  26. //{{AFX_DATA_INIT(CLgSubVideoDlg)
  27. // NOTE: the ClassWizard will add member initialization here
  28. //}}AFX_DATA_INIT
  29. m_pReportDlg = NULL;
  30. m_bDirty = TRUE;
  31. }
  32. void CLgSubVideoDlg::DoDataExchange(CDataExchange* pDX)
  33. {
  34. CDialog::DoDataExchange(pDX);
  35. //{{AFX_DATA_MAP(CLgSubVideoDlg)
  36. // NOTE: the ClassWizard will add DDX and DDV calls here
  37. //}}AFX_DATA_MAP
  38. }
  39. BEGIN_MESSAGE_MAP(CLgSubVideoDlg, CDialog)
  40. //{{AFX_MSG_MAP(CLgSubVideoDlg)
  41. ON_WM_PAINT()
  42. ON_WM_SIZE()
  43. //}}AFX_MSG_MAP
  44. END_MESSAGE_MAP()
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CLgSubVideoDlg message handlers
  47. BOOL CLgSubVideoDlg::Create(CLgReportDlg *pReportDlg, CWnd *pParentWnd, CRect *pRect )
  48. {
  49. m_pReportDlg = pReportDlg;
  50. if( !CDialog::Create( IDD, pParentWnd ) )
  51. return FALSE;
  52. ShowWindow( SW_SHOW );
  53. CRect rect;
  54. if( pRect )
  55. rect = *pRect;
  56. else
  57. pParentWnd->GetClientRect( &rect );
  58. MoveWindow( &rect );
  59. return TRUE;
  60. }
  61. void CLgSubVideoDlg::OnPaint()
  62. {
  63. CPaintDC dc(this);
  64. dc.BitBlt( 0, 0, m_MemoryDC.GetSize().cx, m_MemoryDC.GetSize().cy, &m_MemoryDC, 0, 0, SRCCOPY );
  65. }
  66. void CLgSubVideoDlg::OnSize(UINT nType, int cx, int cy)
  67. {
  68. CDialog::OnSize(nType, cx, cy);
  69. m_MemoryDC.Create( cx, cy );
  70. }
  71. BOOL CLgSubVideoDlg::Draw( CLgImageJPEG *pJpeg )
  72. {
  73. if( !pJpeg && !m_bDirty )
  74. return TRUE;
  75. CSize size = m_MemoryDC.GetSize();
  76. if( !pJpeg )
  77. m_MemoryDC.Create( size.cx, size.cy );
  78. else
  79. {
  80. CLgImageDIB dib;
  81. if( dib.Create( pJpeg ) )
  82. {
  83. CRect rect( 0, 0, size.cx, size.cy );
  84. dib.Draw( m_MemoryDC.GetSafeHdc(), &rect );
  85. m_bDirty = TRUE;
  86. }
  87. }
  88. CClientDC dc( this );
  89. dc.BitBlt( 0, 0, m_MemoryDC.GetSize().cx, m_MemoryDC.GetSize().cy, &m_MemoryDC, 0, 0, SRCCOPY );
  90. return TRUE;
  91. }