Specifying the Playback-Area Origin and Extents

You can specify the origin and extents of the playback area within the stage window. Use the following command messages and flags to specify the origin and extents of the playback area, and to obtain the authored frame size.

Message Flag Description

MCI_WHERE MCI_ANIM_WHERE_SOURCE Obtains original frame size.
  MCI_ANIM_WHERE_DESTINATION Obtains origin and size of the frame as displayed in the playback window.
MCI_PUT MCI_ANIM_PUT_SOURCE Not supported.
  MCI_ANIM_PUT_DESTINA TION Sets the origin and size of the movie frame within the playback window.

In the following code fragment, an application centers the playback area within the stage-window client area:

MCI_ANIM_RECT_PARMS mciRect;
RECT rc;

// Get height and width of movie frames

dwError = mciSendCommand(wDeviceID, MCI_WHERE,
                            MCI_ANIM_WHERE_SOURCE | MCI_ANIM_RECT,
                            (DWORD)(LPVOID)&mciRect);

if(dwError)
    showError(dwError);
else
{
    // Get height and width of window client area
    GetClientRect(hWndFull, (LPRECT)&rc);

    // Top =  client height - frame height / 2
    // Left = client width  - frame width  / 2
    mciRect.rc.top  = max(0, ((rc.bottom - mciRect.rc.bottom) / 2));
    mciRect.rc.left = max(0, ((rc.right  - mciRect.rc.right)  / 2));

    dwError = mciSendCommand(wDeviceID, MCI_PUT,
                     MCI_ANIM_PUT_DESTINATION | MCI_ANIM_RECT,
                     (DWORD)(LPVOID)&mciRect);
    if(dwError)
        showError(dwError);
}