The following code illustrates how to cause a video device to capture the current video image and store it as an image device element.

   MCI_CAPTURE_PARMS mciCaptureParms;
   USHORT  usUserParm = 0;
   ULONG   ulReturn;

   /* Without a rectangle */
   memset (&mciCaptureParms, 0x00, sizeof (MCI_CAPTURE_PARMS));
   mciCaptureParms.hwndCallback = hwndNotify;
   mciCaptureParms.rect       = 0;

   ulReturn = mciSendCommand(usDeviceID, MCI_CAPTURE,
                  MCI_WAIT,
                  (PVOID)&mciCaptureParms,
                  usUserParm);

   /* With a rectangle */
   memset (&mciCaptureParms, 0x00, sizeof (MCI_CAPTURE_PARMS));
   mciCaptureParms.hwndCallback = hwndNotify;
   mciCaptureParms.rect.xLeft   = ulX1;
   mciCaptureParms.rect.yBottom = ulY1;
   mciCaptureParms.rect.xRight  = ulX2;
   mciCaptureParms.rect.yTop    = ulY2;


   ulReturn = mciSendCommand(usDeviceID, MCI_CAPTURE,
                  MCI_WAIT | MCI_CAPTURE_RECT,
                  (PVOID)&mciCaptureParms,
                  usUserParm);


[Back] [Next]