Results 1 to 3 of 3

Thread: Playing AVI through MCI [resolved]

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    135

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width