Your SlideShare is downloading. ×
0
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Cam Capture
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Cam Capture

1,692

Published on

Capturing web cam frames with a .Net application

Capturing web cam frames with a .Net application

Published in: Technology, Art & Photos
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,692
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

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

×