Cam Capture

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Cam Capture - Presentation Transcript

    1.  
    2.  
    3.  
      • Incorporating video capturing capabilities into our application.
      • Connecting
      • Listing available video capture devices
      • Used to manipulate various windows.
      • Mechanism of .Net language calling unmanaged functions in DLL’s.
      • Calling Windows API functions
      • Calling third-party functions provided in DLLs
      • List all available capture devices installed in the system
      • Select the appropriate device
      • Create a capture window
      • Connect the camera
      • Start camera preview and capture
      • Disconnect camera
      • Stop Recording and release memory
      • Dim DriverName As String = Space(80)
      • Dim DriverVersion As String = Space(80) 
        • capGetDriverDescriptionA(0, DriverName, 80,DriverVersion, 80)
      •  
      • Declare Function capGetDriverDescriptionA Lib "avicap32.dll" _
      • (ByVal wDriverIndex As Short, _
      • ByVal lpszName As String, ByVal cbName As Integer, _
      • ByVal lpszVer As String, _
      • ByVal cbVer As Integer) As Boolean
    4.  
      • Private windowHandle As Integer
      • Const WS_CHILD = &H40000000
      • Const WS_VISIBLE = &H10000000
      • nID = 0 (index of camera) (eg: index is 1 then nID=1)
      • windowHandle = capCreateCaptureWindowA("My Cam", WS_CHILD Or WS_VISIBLE, xPos, yPos, wWidth, wHight, parentHandle, nId)
      • Private Declare Function capCreateCaptureWindowA Lib "avicap32.dll“ (ByVal lpszWindowName As String, ByVal dwStyle As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Short, ByVal hWndParent As Integer, ByVal nID As Integer) As Integer
      • Const WM_CAP_START = &H400S 
      • Const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10
      • SendMessage(windowHandle, WM_CAP_DRIVER_CONNECT, 0, 0)
      • Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Int32, ByVal lParam As Int32) As Integer
      • Const WM_CAP_SET_PREVIEWRATE = WM_CAP_START + 52
      • Const WM_CAP_SET_PREVIEW = WM_CAP_START + 50
      • Private frameRate As Integer = 25
      • '---start previewing the image--- SendMessage(windowHandle, WM_CAP_SET_PREVIEW, 1,0)
      • '---set the preview rate ---  
      • SendMessage(windowHandle, M_CAP_SET_PREVIEWRATE, frameRate, 0)
      • ‘ --- Capturing---
      • SendMessage(windowHandle, WM_CAP_SEQUENCE, 0, 0)
      • SendMessage(windowHandle, WM_CAP_DRIVER_DISCONNECT, 0, 0)
      • SendMessage(windowHandle, WM_CAP_STOP, 0, 0)
      • '-- This function destroys the specified window —
      • DestroyWindow(windowHandle)
      • Declare Function DestroyWindow Lib "user32" _ (ByVal hndw As Integer) As Boolean
    5.  
    SlideShare Zeitgeist 2009

    + MobME TechnicalMobME Technical Nominate

    custom

    178 views, 0 favs, 0 embeds more stats

    Capturing web cam frames with a .Net application

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 178
      • 178 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories