AppIPTransformView.cpp
上传用户:hhs829
上传日期:2022-06-17
资源大小:586k
文件大小:3k
- // AppIPTransformView.cpp : implementation of the CAppIPTransformView class
- //
- #include "stdafx.h"
- #include "AppIPTransform.h"
- #include "AppIPTransformDoc.h"
- #include "AppIPTransformView.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CAppIPTransformView
- IMPLEMENT_DYNCREATE(CAppIPTransformView, CView)
- BEGIN_MESSAGE_MAP(CAppIPTransformView, CView)
- //{{AFX_MSG_MAP(CAppIPTransformView)
- ON_COMMAND(IDM_PLAY, OnPlay)
- ON_WM_SIZE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CAppIPTransformView construction/destruction
- CAppIPTransformView::CAppIPTransformView()
- {
- // TODO: add construction code here
- }
- CAppIPTransformView::~CAppIPTransformView()
- {
- }
- BOOL CAppIPTransformView::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CAppIPTransformView drawing
- void CAppIPTransformView::OnDraw(CDC* pDC)
- {
- CAppIPTransformDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code for native data here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CAppIPTransformView diagnostics
- #ifdef _DEBUG
- void CAppIPTransformView::AssertValid() const
- {
- CView::AssertValid();
- }
- void CAppIPTransformView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- CAppIPTransformDoc* CAppIPTransformView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAppIPTransformDoc)));
- return (CAppIPTransformDoc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CAppIPTransformView message handlers
- void CAppIPTransformView::OnPlay()
- {
- CString strFilter = "AVI File (*.avi)|*.avi|";
- strFilter += "MPEG File (*.mpg;*.mpeg)|*.mpg;*.mpeg|";
- strFilter += "All Files (*.*)|*.*|";
- CFileDialog dlgOpen(TRUE, NULL, NULL, OFN_PATHMUSTEXIST | OFN_HIDEREADONLY,
- strFilter, this);
- if (IDOK != dlgOpen.DoModal())
- {
- return;
- }
- WCHAR wchFile[MAX_PATH];
- MultiByteToWideChar(CP_ACP, 0, dlgOpen.GetPathName(), -1, wchFile, MAX_PATH);
- m_Graph.BuildFromFile(wchFile);
- m_Graph.MakeChild(GetSafeHwnd());
- m_Graph.Run();
- }
- void CAppIPTransformView::OnSize(UINT nType, int cx, int cy)
- {
- CView::OnSize(nType, cx, cy);
- RECT rc;
- GetClientRect(&rc);
- m_Graph.ResizeVideoWindow(&rc);
- }