PDA

View Full Version : How do i get a webcam to work with VB 2008 express???



elios
10-17-2008, 07:56 PM
As the title says, How do i get a webcam to work with a VB 2008 windows form??

what code do i need? (i am rather new to this and i cannot find any code on the internet)
could someone plz write up some sample code for me???

Thanks,

Adrenalynn
10-18-2008, 10:51 PM
What webcam? Does it support DirectX?

elios
10-18-2008, 11:12 PM
Hiya Addy, Its a Logitech notebook Quickcam : http://www.logitech.com/index.cfm/webcam_communications/webcams/devices/2989&cl=nz,en : im not sure if it uses direct x

cheers

Adrenalynn
10-19-2008, 12:22 AM
Yuppers. That's a DirectX/DirectShow device.

http://www.quickcamteam.net/documentation/faq/can-i-use-logitech-webcams-for-my-own-application

elios
10-19-2008, 12:43 AM
okay thanks, but i am not to sure on how to merge this with a vb program? it seems to be confusing me...

elios
10-19-2008, 01:00 AM
i dont know anything about C++ and i cant exactly download 1.33GB of proggy editor, when our monthly cap is 5gb between a family of three....

I would kinda like to know if ne body has any code for vb ex. 2008

Adrenalynn
10-19-2008, 03:44 AM
http://www.codeproject.com/KB/audio-video/WebcamUsingDirectShowNET.aspx

There's hundreds of samples that a google search will turn up. That was the most promising first-page sample from a search like: +visual-basic +directshow +camera +source-code

elios
10-21-2008, 12:37 AM
okay, thanks. i didnt turn over much results. all the stuff i found was stuff i had already looked at. I have downloaded Visual C#, is it any easier (if u no wat i mean)?

Adrenalynn
10-21-2008, 01:19 AM
The process is identical. It's all dotNet.

Did you see the source code that will compile and show a webcam display on the screen, doing exactly what you asked, in visual basic, at the top of the link I posted? http://www.codeproject.com/KB/audio-video/WebcamUsingDirectShowNET.aspx

What _specifically_ is lacking in that example?

elios
10-21-2008, 01:39 AM
i dont know anything about C++ and i cant exactly download 1.33GB of proggy editor, when our monthly cap is 5gb between a family of three....

I would kinda like to know if ne body has any code for vb ex. 2008

firstly, it the code isnt compatible with vb 2008, secondly i cant get the program to run, thirdly it requires a directshaw thing programmer fourth, to get the programmer i need to download 1.33gb of editor, and i dont have that amount of data usage with our plan (welcome to the _hole_; New Zealand)

Adrenalynn
10-21-2008, 03:05 AM
Yeah, compiles fine on VB 2008.

No directshow, no camera. Sorry - that's how 32bit Windows works. You'll either need DirectX or go back to Windows 3.11...

[edit: Ok - that's a bit of an exaggeration. You could use Windows 95 and an old VfW driver-model camera, like the early "golf ball" logitec quickcams, USB1.1 low-res stuff]

srobot
10-21-2008, 09:07 AM
elios -- Are you using VS *express*? Aka did you buy the software, or are you using the free stuff?

Adren -- I think, like me, you have the full version (paid)? This may be why it is not compiling, express editions do not handle all code.

There was some way to get the full version for free... I can't seem to remember now as I never did it... Let me know if you would like to know how, and I can ask my friend how, then post a tutorial here.

Adrenalynn
10-21-2008, 11:37 AM
Naw, not on this machine, it's just Express.

elios
10-21-2008, 11:42 PM
okay, it comes up with build errors; would you like to debug from the last successful build? OK then it does something random and goes back to the code screen...

Adrenalynn
10-22-2008, 12:35 AM
>> then it does something random and goes back to the code screen...

I think you might need to learn the tools on a simpler project or two first. Likely your paths are wrong or you're missing libraries (that you can't download, hence can't use, hence can't use the project, right?)

elios
10-22-2008, 09:44 PM
yea, something like that... thanks

srobot
10-22-2008, 10:06 PM
Adren - Maybe you could suggest a good tutorial or learning videos or something so elios can learn what he's trying to do?

Adrenalynn
10-22-2008, 10:52 PM
That's the problem. He apparently can't come up with DirectX. So his obvious option is to spend the next few years learning enough to rewrite DirectX - or switch to 16bit Windows - or switch to Linux. The downside is that downloading Linux is going to be equivalent to downloading DirectX.

Basically - he can't get there from here.

elios
10-22-2008, 11:53 PM
hehe, we have a computer running the latest ubuntu (in NZ).... maybe i could give it a shot.. lol.
I think i might give it a miss for now.

My overall goal was to wirelessly control my scout via blutooth using a joystick and a webcam that was mounted on my bot.

Cheers,

Adrenalynn
10-23-2008, 01:01 AM
It's a good/perfectly doable goal. You just need some standard free tools - or someplace to download said standard free tools. :)

Obscene
11-24-2008, 04:13 PM
Have you tried finding DirectX as a torrent?

Just use UTorrent: It's an extremely light-weight torrent program, and the good part is, you can preset the bandwidth allocation so that it will download very slowly, but it won't eat up all of your bandwidth at once.

You can download some of DirectX one month, pause the download, and then un-pause it the next. Etc.

Just a thought.

Edit: Also, I'm almost positive that Microsoft will send you a CD with DirectX on it for a nominal fee.

elios
11-24-2008, 08:45 PM
hmmmmmm thanks

WarriorofHonour
03-24-2009, 01:20 AM
Hey,

I've read most of this post. I use VB 2k8 Express and have a nifty lil set of controls for ya. Now, the hard part for ya might be the downloads (prolly about 150mb max). Now, they have 5 different packages VideoLab, SignalLab, PlotLab, AudioLab and VisionLab. I would suggest getting all 5 but they are really not needed as some controls come with the some packages. The VideoLab.Net package is what your looking for, basically it's just drop in a control, set some properties and badda-bang-badda-boom... video on a form. The site url is:
http://www.mitov.com/html/downloads.html

also check out the Quick Start Manual in .pdf format, it makes setting up the controls in the toolbar super easy. Hope this helps ya.

elios
03-24-2009, 09:46 PM
Cheers, thank you for that.

jtinlv
03-25-2009, 08:16 PM
http://www.codeproject.com/KB/directx/directxcapture.aspx

I use this libary set and have been able to expand to both capture and snapshot quickly in c# and VB.net very easy code to read and understand.

Cheers
John

elios
03-25-2009, 10:59 PM
thank you, also, for this.

Alex
03-26-2009, 08:43 AM
I knew I remembered that article from somewhere! That's the same exact article that I used several years back to learn how to get a webcam feed to work in VS 2005!! It's awesome to see that it's still helping people today:)

+rep