views:

234

answers:

1

Hi,

I am creating an application for video capturing on Windows Mobile device. In the MainFrame there are menu and status window (custom window). The video size width:height ratio is 4:3 so in the case there are some other elements on the screen the video doesn't fill the whole area.

This is the function which arranges screen elements:

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;

}

Does anyone know if there is a way to fill the blank area (the area not filled by status window and menu bar) with video preview without changing the width:height ratio (overwrite a part of video preview with status bar and menu) perhaps with changing the Window Styles flags or any other approach?

Thanks!

+1  A: 

How is the video drawn? I think we need more info here.

Jon Clegg