Screen Captures into Application

Screen Captures into Application - Teach Your Old Web Cam...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
http://www.devx.com Printed from http://www.devx.com/dotnet/Article/30375 Teach Your Old Web Cam New Tricks: Use Video Captures in Your .NET Applications Just when you thought there wasn't anything new that you could do with a webcam, along comes this article, which shows you how to exploit the AVICap Windows class so you can integrate on-demand screen captures into your applications. by Wei-Meng Lee oday, a webcam is a common peripheral, used most often for video conferencing, that most people can easily afford. But what can you do with your webcam besides video conferencing? If you are a developer, the answer is plenty; you will be glad to know that integrating a webcam with an application is not as difficult as you might imagine. Using the AVICap window class available in the Windows operating system, you can easily incorporate video capture capabilities into your Windows application. The uses of this functionality are endless but in particular you can easily populate employee and other person databases with mug shots taken directly from the users' terminal. The AVICap class (located in the avicap32.dll file) contains message-based interfaces to access video and waveform-audio acquisition hardware and provides the ability to capture streaming video to disk. The only downside to the AVICap class is that it is an API and is thus not exposed as a managed class to the .NET developer. Hence, as a .NET developer you'll need to use Platform Invoke (P/Invoke) to make use of the API. In this article, I will show you how to incorporate video capabilities into your .NET Windows applications. In particular, you will learn how to: l preview video input (within your Windows application) from your Webcam l record streaming video l capture images using your webcam. In addition, I will develop a Windows application that puts the new video capability to good use. You will see how you can use the techniques discussed to take photos of new users in a registration system. Using the AVICap Class To show how to use the AVICap class for integrating video into your Windows application, I'll use Visual Studio 2005 to create a new Windows application project. I'll name the project C:\VideoCapture. The application that you will build will list all the video sources available on your computer. You can then select a video source (in this case, your webcam) and preview its content. You will also learn how to record a video stream to file. First, populate the default Windows Form using the controls shown in Figure 1 . You will need a ListBox control for displaying the video sources on your computer, a PictureBox control, with which to preview the video captures, and three Button controls to start and stop the video recording as well as to stop the selected camera. Switch to the code-behind of the form and import the following
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/16/2008 for the course MIS 225 taught by Professor Byrtus during the Winter '08 term at Mercyhurst University.

Page1 / 8

Screen Captures into Application - Teach Your Old Web Cam...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online