他のヒント

WebCam Capture プロジェクトを使用して使用できます。Windows XP、Vista、7、Linux、Mac OS、Raspberry PIなどで取り組んでいます。Webカメラから画像を表示するために使用できるJPanelを拡張するための準備完了スイングコンポーネントがあります。この例これを行う方法の詳細については、このコンポーネントの高度な機能を提示しますが、基本的な使用法は次のようになります。

JFrame window = new JFrame("Test webcam panel");
window.add(new WebcamPanel(Webcam.getDefault()));
window.pack();
window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
.

このコードを実行した後は、WebCAMの中にある画像を使用してJFrameを表示する必要があります。

Webcam.setAutoOpenMode(true);
BufferedImage image = Webcam.getDefault().getImage();
ImageIO.write(image, "PNG", new File("F:/test.png"));
.

https://github.com/sarxos/webcam-capture(https://withub.com/sarxos//webcam-capture(https://withub.com/sarxos//webcam-capture)>

とzipファイルにある他のライブラリファイルを追加する

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top