webcam directly to bitmap (no GUI, console application)

D

Dazza

G'day,

I'm looking for a way to save a webcam frame image to a bitmap. I don't
want to go via a PictureBox like many examples I've found on the net,
because I will have no forms, or GUI (console app).

The reason I'm looking to do this is so I can take a picture at intervals
and save them to the computer (like time lapse). If at all possible it
would be good if I can print a time stamp on the image too before saving on
the computer. I know this is all easy enough using a PictureBox (there are
many examples of this on the net), but this must all be done in a console
application.

Is this possible? I'm fairy inexperienced with this kind of hardware
manipulation, so any source code would be very appreciated!

Many thanks,
Dazza.
 
K

kimiraikkonen

G'day,

I'm looking for a way to save a webcam frame image to a bitmap. I don't
want to go via a PictureBox like many examples I've found on the net,
because I will have no forms, or GUI (console app).

The reason I'm looking to do this is so I can take a picture at intervals
and save them to the computer (like time lapse). If at all possible it
would be good if I can print a time stamp on the image too before saving on
the computer. I know this is all easy enough using a PictureBox (there are
many examples of this on the net), but this must all be done in a console
application.

Is this possible? I'm fairy inexperienced with this kind of hardware
manipulation, so any source code would be very appreciated!

Many thanks,
Dazza.

Have you looked up screenshot examples GDI-based? There are good
classes bitBlt functions allow you to handle and save active window
which may help you to save webcam screen.
 
D

Dazza

I want to handle all the webcam input internally from this console app - so
capturing a screen shot of the webcam's software isn't an option.
basically, this app will be doing a heap of other stuff, so it will need to
capture a frame from a webcam, preferably print a timestamp on it, and then
save it to a bitmap without displaying it on screen at all.

Thanks~~
 
K

kimiraikkonen

I want to handle all the webcam input internally from this console app - so
capturing a screen shot of the webcam's software isn't an option.
basically, this app will be doing a heap of other stuff, so it will need to
capture a frame from a webcam, preferably print a timestamp on it, and then
save it to a bitmap without displaying it on screen at all.

Thanks~~

Are you looking for that kind of things?
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1339&lngWId=10
 
D

Dazza

Yeah I actually saw that when I was searching around. This relies on a
PictureBox control though. It uses the PictureBox's handle and streams the
webcam directly to that.

Like you say it will be interesting to see how something usually reliant on
GUI can be done in a console app. I'm hoping someone can show me how it's
done!

Thanks,
Dazza
 
D

Dazza

Can anyone point me in the right direction with this? Or give me an idea of
what might 'theoretically' work so I can look into it? I really don't know
where I should be looking to solve this. ANY input is very much
appreciated!!

Thanks,
Dazza
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top