|
How to capture video to full screen in Visual Basic Express 2008 The Problem TV capture devices that use standard Microsoft WDM drivers have a maximum resolution of 720 x 576 . That frame has a 5:4 ratio, so when the TV is broadcasting a film in 16:9 ratio, you get black filler strips along the top and bottom of the frame. My monitor has a native resolution of 1440 x 900 , a ratio of 8:5 . So when the 5:4 ratio frame is displayed inside the 8:5 monitor, you get black filler strips along the left and right edges of the monitor. What I want is to be able to zoom the picture as much as I like, so the good bits fill the screen. The Solution This application is written in Visual Basic Express 2008. The zipped project files can be downloaded from : www.peakoil.org.au/dave.kimble/doctor/kvideocapture/videocapture.zoom.zip [ 1.0 MB ] It is a simple example of capturing a video stream from the first Imaging Device in Device Manager's list, and putting it on the screen centred and zoomable - so any unnecessary black filler around the picture can be eliminated. There is a form the same size as the monitor screen ( 1440 x 900 ) in this case. And there is a PictureBox control that starts with size ( 1126 x 900 ) - in proportion 5:4 like the ( 720 x 576 ) output of the imaging device ( Belkin F5U228 "Hi-Speed USB2 DVD Creator" ). When the mouse-wheel is rolled, the PictureBox.Size is increased/decreased, keeping the proportions and changing PictureBox.Location to keep the control centred on the form. Double-click to bring up the input device driver controls, that let you choose colour system, adjust brightness/contrast/etc. Press ALT+F4 to close the application. This project started off using code from Ken Homza's video capture application at http://www.a1vbcode.com/download.asp?ID=2470 without which this project would not have been possible. But it has changed so much since then that Ken can't be blamed for anything. I have subsequently discovered a mine of information at MSDN: Video Capture: A minimal approach , particularly the reference section at http://msdn.microsoft.com/en-us/library/ms713476(VS.85).aspx . This is the event code:
|