如何在Windows Mobile上使用视频预览填充屏幕

时间:2008-12-18 14:14:03

标签: c++ windows-mobile size

我正在Windows Mobile设备上创建一个视频捕获应用程序。在MainFrame中有菜单和状态窗口(自定义窗口)。视频大小宽高比为4:3,因此如果屏幕上还有其他元素,则视频不会占据整个区域。

这是安排屏幕元素的功能:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    ToggleFullScreen(TRUE);
    CScreenOrientation::SetScreenOrientation(270);
    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
        return -1;

    RECT r;
    GetWindowRect(&r);
    if (!m_wndStatus.Create(NULL, NULL, WS_CHILD | WS_VISIBLE, 
                CRect(0, 0, r.right, TOOLBAR_HEIGHT), this, AFX_IDW_PANE_FIRST + 1, NULL))
    {
        TRACE0("Failed to create status view\n");
        return -1;
    }

    // Create a camera view
    if (!m_wndCameraView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
        CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
    {
        TRACE0("Failed to create camera view\n");
        return -1;
    }
    m_wndCameraView.SetLogDirectory(m_Settings.m_LogDirectory);

    if (!m_wndCommandBar.Create(this) ||
        !m_wndCommandBar.AddAdornments(dwAdornmentFlags) ||
        !m_wndCommandBar.InsertMenuBar(IDR_MAINFRAME))
    {
        TRACE0("Failed to create CommandBar\n");
        return -1;      // fail to create
    }

    m_wndCommandBar.SetBarStyle(m_wndCommandBar.GetBarStyle() | CBRS_SIZE_FIXED);

    m_QueueProgressData.SetHandle(this);

    // Update GUI state
    UpdateGUIState();

    //VideoPreviewShow();

    // TODO: check error
    m_SleepModeTimerID = SetTimer(1, (UINT)1000, (TIMERPROC)CMainFrame::SleepModeTimer);

    PostMessage(WM_CHECK_UPGRADE, 0, 0);

    return 0;
}

有没有人知道是否有办法用视频预览填充空白区域(未填写状态窗口和菜单栏的区域)而不更改宽度:高度比(用状态栏和菜单覆盖视频预览的一部分) )或许改变窗口样式标志或任何其他方法?

0 个答案:

没有答案