PDA

Click to See Complete Forum and Search --> : mci control


debs
May 14th, 2002, 05:32 AM
Hi

How to use mci control to process a video in real time?

Libero
May 14th, 2002, 05:59 AM
If you mean the "MControl" then:

MControl.Command = "close"
MControl.DeviceType = "AVIVideo"
MControl.FileName = "Path to your avi file here"
MControl.Command = "open"
MControl.Command = "Play"

From MSDN:

The argument device$ is the type of MCI device to open: AVIVideo, CDAudio, DAT, DigitalVideo, MMMovie, Other, Overlay, Scanner, Sequencer, VCR, Videodisc, or WaveAudio.

debs
May 14th, 2002, 06:10 AM
This is the good control, but I don't want it to open a window, I want to play it into an invisible picturebox because I have to draw some rectangles on it and also to know the original image...

How can I do that?

Libero
May 14th, 2002, 07:34 AM
I dont know how to do it in a MControl but u can use this API:

Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long) As Long







Private Sub Command1_Click()


Last$ = Picture1.hWnd & " Style " & &H40000000
ToDo$ = "open Your AVI file goes here Type avivideo Alias video parent " & Last$
x% = mciSendString(ToDo$, 0&, 0, 0)
x% = mciSendString("put video window at 0 0 210 210", 0&, 0, 0)
x% = mciSendString("play video wait", 0&, 0, 0)
x% = mciSendString("close video", 0&, 0, 0)
End Sub


Private Sub Form_Unload(Cancel As Integer)
x% = mciSendString("close video", 0&, 0, 0)
End Sub

Libero
May 14th, 2002, 07:40 AM
I just found this thread:

http://www.vbforums.com/showthread.php?s=&threadid=167437&highlight=MMControl

debs
May 14th, 2002, 08:01 AM
I wrote that thread, but there's no reply!! :(