Code: Select all
import com.github.sarxos.webcam.Webcam;
import javax.imageio.ImageIO;
import java.io.File;
import java.io.IOException;
public class WebcamTutorial {
public static void main (String[] args) {
Webcam webcam = Webcam.getDefault();
webcam.open();
try {
ImageIO.write(webcam.getImage(), "JPG", new File("C:\\Users\\Joe User\\Desktop\\firstCapture.JPG"));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
< /code>
Hier ist mein Clojure -Versuch, dasselbe zu tun: < /p>
(ns webcam2.core
(:import java.io.File)
(:import java.io.IOException)
(:import javax.imageio.ImageIO)
(:import com.github.sarxos.webcam.Webcam)
(defn -main []
((let [webcam (Webcam. (getDefault.))]
(webcam. open.)
(ImageIO.write. webcam. getImage. "JPG", new .File ("C:\\Users\\Joe User\\Desktop\\firstClojureCapture.JPG"))
)
)
)
)
< /code>
Ich bekomme "Unused Imports
Code: Select all
com.github.sarxos.webcam.Webcam
Ich weiß nicht>