|
-
Jun 4th, 2004, 08:54 PM
#1
Thread Starter
Addicted Member
Playing AVI through MCI [resolved]
Ok, here is the problem...
I am playing with playing an AVI file through the MCI, and ran into a problem when it comes to the video.
The video has a background that's transparent, which keeps appearing at Magenta on my form.
Is there way to show it actually transparent?
Here is my code....
On a form, add:
3 command buttons
1 picture box
1 timer
Code:
Private Declare Function mciSendString Lib "winmm" Alias "mciSendStringA" (ByVal _
lpstrCommand As String, ByVal lpstrReturnString As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Dim sAlias As String
Dim rReturn As Long
Private Sub Command1_Click()
Dim mssg As String * 255
sTheFile = "c:\filecopy.avi"
sAlias = Right$(sTheFile, 3) & Minute(Now)
nReturn = mciSendString("Open " & sTheFile & " ALIAS " & sAlias & " TYPE AviVideo wait parent " & Picture1.hWnd & " Style " & &H40000000, "", 0, 0)
nReturn = mciSendString("set " & sAlias & " time format ms", 0&, 0, 0)
nReturn = mciSendString("status " & sAlias & " length", mssg, 255, 0)
Timer1.Interval = mssg + 500
Me.Caption = mssg
End Sub
Private Sub Command2_Click()
nReturn = mciSendString("play " & sAlias, 0&, 0, 0)
Timer1.Enabled = True
End Sub
Private Sub Command3_Click()
nReturn = mciSendString("stop " & sAlias, 0&, 0, 0)
nReturn = mciSendString("close " & sAlias, 0&, 0, 0)
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
nReturn = mciSendString("play " & sAlias & " from 0", 0&, 0, 0)
End Sub
The video is the FILECOPY.AVI from the Microsoft Visual Studio\Common\Graphics\Videos folder.
Any help would be greatly appreciated....
Last edited by JasonC; Jun 5th, 2004 at 08:25 AM.
-
Jun 5th, 2004, 02:52 AM
#2
Addicted Member
All the program I opened it in showed the magneta, not sure what call you need to make it transparent. Can you use a gif instead?
Google turned up this for me:
http://www.programmersheaven.com/zone1/cat372/207.htm
http://www.vbaccelerator.com/home/VB...er/article.asp
http://www.vbcodemagician.dk/resources/vcanim.htm (seperate control)
Let me know if any of these work! Otherwise, you got the gif!
-
Jun 5th, 2004, 08:23 AM
#3
Thread Starter
Addicted Member
Thanks
I downloaded the gif (incase) but so far the 12kb control from vbcodemagician is appearing to be the best solution.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|