Results 1 to 6 of 6

Thread: Getting image from Webcam

  1. #1

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180

    Getting image from Webcam

    Hi,


    Does anyone know if there are (standard) controls to capture the images of my webcam?

    It comes with special software that does it, but it's also possible in Windows itself.
    When I select my webcam in "My Computer" it shows the output of my webcam, and I have the possibility to take a picture...

    So does that mean there is a function for that in Windows?

    I heard something about using WIA, but I have no idea how that works...

    I'm using XP Pro, and my webcam is using USB...


    Cheers,

    CJ

  2. #2

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    *bump*

  3. #3
    New Member
    Join Date
    Mar 2012
    Posts
    9

    Re: Getting image from Webcam

    2012

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Getting image from Webcam

    There are four basic ways to get at webcams:
    • API provided by the manufacturer through a specific SDK.
    • DirectX.
    • WIA before Windows 6.0 (Vista).
    • Video for Windows (AviCap before Win95, AviCap32 since).


    WIA had this ripped out, supposedly due to some DRM issues. Since it was fairly short-lived for this purpose (XP only, or perhaps later Win2K SP levels) there are fewer examples.

    DirectX can be a monster to work with, though many programmers will say it's "the way to go." VB6 support is thin past XP though and there is no supported DirectX SDK version with a VB6-friendly API past WinXP. Thus for most purposes it can be considerd dead.

    The Video for Windows API is old and crusty, and battles a little with the newer webcam driver model in Windows. It can be a struggle on systems with multiple webcams snce thy all end up mapped to a single VfW pseudo-device (" Microsoft WDM Image Capture (Win32)").

    However if you have just one webcam connected to the machine at a time VfW can be far less grief to work with than the alternatives. There are also lots of sample programs and code snippets around just because VfW has lived so long. It existed on old 16-bit Windows (certainly it was in Win3.1) and still lives on in Win8 - though i have not personally tested it there.

    My suggestion would be to go do a search here within the VB6 CodeBank. You ought to find a few working examples just searching on "webcam" as a keyword.

  5. #5
    Junior Member
    Join Date
    Sep 2012
    Location
    Cascais, Portugal
    Posts
    31

    Re: Getting image from Webcam

    If the webcam is DirectShow-compatible, that's probably the easiest way to go. It lets you enumerate the capture devices on your machine and select one as the source. You can then either preview the video or grab bitmaps from it. Geraint Davies, Microsoft's original ActiveMovie lead developer, has some useful examples/wrappers in the VB section of his site (http://www.gdcl.co.uk/vb.htm).

  6. #6
    Lively Member mikorians's Avatar
    Join Date
    Jun 2010
    Location
    In a fog
    Posts
    83

    Re: Getting image from Webcam

    Examine this. It uses AviCap32.dll, which should be fairly standard. I'm no expert, but the code seemed sound.
    http://www.vbforums.com/showthread.p...-view-(VB-5-6)

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