All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.sarxos.webcam.WebcamUtils Maven / Gradle / Ivy

Go to download

This library allows you to use your PC webcam, IP or network cameras directly from Java. It's compatible with most operating systems (Windows, Linux, MacOS).

There is a newer version: 0.3.12
Show newest version
package com.github.sarxos.webcam;

import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;



public class WebcamUtils {

	public static final void capture(Webcam webcam, String filename) {
		try {
			ImageIO.write(webcam.getImage(), "PNG", new File(filename + ".png"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy