QMedia Video media commands |

### QM_AddVideoMediaImage

QM_AddVideoMediaImage(movieRef; trackID; sampleTime; sampleDuration; imagePath):error
| movieRef | Longint | Movie reference
| trackID | Longint | Track ID
| sampleTime | Longint | Sample time
| sampleDuration | Longint | Sample duration
| imagePath | Text | Path to image file
| error | Longint | Error result

Adds an image file to a video track.

Parameter movieRef is the reference to the movie instance. The movie reference must have been previously obtained with a call to QM_NewMovieFromFile.

Parameter trackID is the ID of the video track.

Parameters sampleTime and sampleDuration specify the insertion point and duration of the video sample. Both must be expressed in the movie's time scale. If sampleTime is -1, the video sample is added to the end of the track. In that case, parameter sampleTime also receives the actual time at which the sample was added.

Parameter imagePath is the full pathname to the image file. If imagePath is invalid, a file system error is returned. If imagePath is empty, QMedia presents the file selection dialog where the user can preview and select an image file. If the user selects a file, its full pathname is returned in imagePath, otherwise error qm_userCancelErr is returned.

Example

``Insert an image from a file to the beginning of video track ID trackID for 5 seconds` `` `C_LONGINT($timeScale)` `$err:=QM_GetTimeScale ($movie;$timeScale) `Get movie time scale` `` `C_LONGINT($sampleTime;$sampleDuration)` `$sampleTime:=0 `Insert at beginning` `$sampleDuration:=$timeScale*5 `5 seconds duration` `` `C_TEXT($imagePath)` `$imagePath:="" `Let user select image file` `` `$err:=QM_AddVideoMediaImage ($movie;$trackID;$sampleTime;$sampleDuration;$imagePath)` ``

Related commands

QM_AddVideoMediaPicture | Adds a picture as a sample to a video track.
QM_SetVideoMediaBackColor | Changes the background color of new video samples.
QM_SetVideoMediaDisplayFormat | Changes the display format of new video samples.
QM_SetVideoMediaCompression | Changes the compression options of new video samples.

QMedia © Escape OE
Generated by QDoc 2.8 on Thu, Nov 24, 2011 18:42:31