## QMedia v1.5 | ## Using QMedia

Home | Playback | Internet delivery | Grabbing

Requirements | How grabbing works | Grabber setup

## Setting up for grabbing

1. Create a grabber plug-in area on your form

Draw a fixed-size plug-in area on your form and designate it as a _Grabber area.

Important: Make sure the grabber area is NOT resizeable or unexpected behavior may occur!

2. Add a video channel to the grabber area

`C_LONGINT($videoChannel)`

`$error:=QM_NewChannel (xGrabber;$videoChannel;qm_VideoMediaType)`

3. Configure the video channel and specify usage

The following line of code causes the display of the Channel Settings Dialog:

`$error:=QM_ChannelSettingsDialog (xGrabber;$videoChannel)`

And this line says that this channel will be used for previeweing and for recording:

`$error:=QM_SetChannelUsage (xGrabber;$videoChannel;qm_seqGrabPreview | qm_seqGrabRecord)`

4. Previewing

4a. Start preview

`$error:=QM_StartPreview (xGrabber)`

4b. Stop preview

`$error:=QM_StopPreview (xGrabber)`

5. Recording

5a. Specify the output file

`C_TEXT($path)``
$path:=""`

`$error:=QM_SetGrabberOutput (xGrabber;$path)`

5b. Start recording

`$error:=QM_StartRecording (xGrabber)`

5c. Stop recording

`$error:=QM_StopRecording (xGrabber)`

6. Grab a picture

`C_PICTURE($pict)`

`$error:=QM_GrabPict (xGrabber;$pict)`