Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
Available now!
Buy at Amazon US or
Buy at Amazon UK



Articles

1.Windows API reference
2.HTML to WML Converter
3.Webcam streaming in VB.NET
4.Remoting with firewalls
5.RSA from first principles
6.Key & MouseLogger in .NET
7.Networking Resource Kit for .NET
8.Automatic Reboot with .NET
9.XAML Schema
10.Migrating VB6 Winsock to VB.NET
11.Migrating C++ sockets to C#
12.RFC Reference guide
13.Lingua - Localization webservice
14.COM Reference guide
15.WMI Reference guide
16.SQL stored procedures
17.TCP & UDP port reference
18..NET Framework reference
19.Ethernet Type codes
20.IP to country webservice
21.MAC address assignments
22.DLL entry point reference
23.WHOIS server list
24. Turing Numbers
25. Boost SQL performance
26. Progress Bar in ASP.NET
27. OleDb WebService
27. Internet Explorer

Contact us

Public Const WM_CAP_DRIVER_CONNECT As Integer = WM_USER + 10

Public Const WM_CAP_DRIVER_DISCONNECT As Integer = WM_USER + 11

Public Const WM_CAP_SET_VIDEOFORMAT As Integer = WM_USER + 45

Public Const WM_CAP_SET_PREVIEW As Integer = WM_USER + 50

Public Const WM_CAP_SET_PREVIEWRATE As Integer = WM_USER + 52

The video format is defined in terms of a bitmap, so we must define our standard bitmap structure

    Public Structure BITMAPINFOHEADER

        Dim biSize As Integer

        Dim biWidth As Integer

        Dim biHeight As Integer

        Dim biPlanes As Short

        Dim biBitCount As Short

        Dim biCompression As Integer

        Dim biSizeImage As Integer

        Dim biXPelsPerMeter As Integer

        Dim biYPelsPerMeter As Integer

        Dim biClrUsed As Integer

        Dim biClrImportant As Integer

    End Structure

    Public Structure BITMAPINFO

        Dim bmiHeader As BITMAPINFOHEADER

        Dim bmiColors() As Integer

    End Structure

Now we start getting down-and-dirty into the API, these calls are where the real magic happens. The first three API calls, SetWindowPos, SendMessage, and SendMessageAsBitmap (usually called SendMessageAsAny) are standard windows API calls, and are usually used to position application windows, and send windows messages to them. In our case the application window, is in fact a webcam capture window, and responds to a special set of windows messages.

The capCreateCaptureWindow and capGetDriverDescription are from the Video For Windows API. The former API function is used to create a new webcam capture window, and map a VFW driver to it. The latter API function is used to enumerate VFW devices, such as Webcams on the system.

Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer

    Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Short, ByVal lParam As Integer) As Integer

    Declare Function SendMessageAsBitMap Lib "user32" Alias "SendMessageA" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As BITMAPINFO) As Integer

    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

    Declare Function capGetDriverDescriptionA Lib "avicap32.dll" (ByVal wDriver As Short, ByVal lpszName As String, ByVal cbName As Integer, ByVal lpszVer As String, ByVal cbVer As Integer) As Boolean

   

Page 1  Page 3 



Google

Free SMS UK Free SMS Ireland SMS Gratis Norway SMS Gratis Sverige Ilmainen SMS Suomi SMS Gratis Danmark SMS Tasuta Eestisse SMS Nemokamai Lietuva SMS Bezmaksas Latviju Darmowe smsy Polska SMS Zdarma Ceské SMS Zdarma Slovensko SMS Gratis Deutschland SMS Gratis Schweiz SMS Gratis Österreich SMS Gratuit Belgique SMS Gratis Nederland SMS Gratuit France SMS Gratis Espańa SMS Gratis Portugal Free SMS South Africa Free SMS USA SMS Percuma Malaysia Free SMS Hong Kong