can anybody suggest me on this coding n get me a full pharse of this program ready for execution....
think tis will b a easiest way to capture an image through webcam...!
INCOMPLETE PROGRAM :
```````````````````````````````````
CaptureDeviceInfo deviceInfo = CaptureDeviceManager.getDevice("vfw:Microsoft WDM Image Capture (Win32):0");
Player player = Manager.createRealizedPlayer(deviceInfo.getLocator());
player.start();
// Wait a few seconds for camera to initialise (otherwise img==null)
Thread.sleep(2000);
//take image from camera
FrameGrabbingControl frameGrabber = (FrameGrabbingControl)player.getControl("javax.media.control.FrameGrabbingControl");
Buffer buf = frameGrabber.grabFrame();
Image img1 = (new BufferToImage((VideoFormat)buf.getFormat()).createImage(buf));
.....
then you can save image as image.jpg into buffer your computer
code:
....
BufferedImage buffImg = new BufferedImage(img1.getWidth(null), img1.getHeight(null), BufferedImage.TYPE_INT_RGB);
Graphics2D g2D = buffImg.createGraphics();
g2D.drawImage(img1, null, null);
g2D.setColor(Color.RED);
g2D.setFont(new Font("Verdana",Font.BOLD,16));
g2D.drawString((new Date()).toString(),10,25);
g2D.dispose();
ImageIO.write(buffImg,"jpg",new File("../Test/Webcam/Webcam" + " " + Params.Num + ".jpg"));