Skip to content

Commit

Permalink
Remove debug log, README update, example change
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Nov 14, 2012
1 parent 2b54c92 commit 758f8fe
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
22 changes: 17 additions & 5 deletions README.md
Expand Up @@ -11,19 +11,29 @@ Complete documentation, API, examples, tutorials and many more can be found here

## How To Use

Basic example of how _Webcam Capture_ can be used to get image from PC webcam.

### Basic Example

This is the basic example of how _Webcam Capture_ can be used to get image from PC webcam. Code
below will capture image from your PC webcam and save it in ```test.png``` file in current
directory.
Code below will capture image from your PC webcam and save it in ```test.png``` file:

```java
Webcam webcam = Webcam.getDefault();
BufferedImage image = webcam.getImage();
ImageIO.write(image, "PNG", new File("test.png"));
```

For examples of how to use Webcam Capture with **IP cameras** please follow to the **[appropriate
This one will display image from webcam in ```JFrame``` window:

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

For examples of how to use Webcam Capture with **IP cameras** please follow the **[appropriate
subproject](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-driver-ipcam)**.

### Maven
Expand All @@ -48,7 +58,9 @@ containing all required JARs. ZIP for version 0.3.1 is available for download

## News

* 14-11-2011 - Version 0.3.4 released, additional driver supporting IP cameras
* 14-11-2011 - Version 0.3.4 released:
** Additional driver supporting IP / network cameras,
** Better repainting in ```WebcamPanel``` component,

## License

Expand Down
Expand Up @@ -6,12 +6,8 @@
public class WebcamPanelExample {

public static void main(String[] args) {

WebcamPanel panel = new WebcamPanel(Webcam.getDefault());
panel.setFPS(5);

JFrame window = new JFrame("Test webcam panel");
window.add(panel);
window.add(new WebcamPanel(Webcam.getDefault()));
window.pack();
window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Expand Down
Expand Up @@ -35,8 +35,6 @@ public void run() {

while (webcam.isOpen()) {

LOG.debug("Read image");

image = webcam.getImage();
if (image == null) {
LOG.error("Image is null");
Expand All @@ -52,7 +50,7 @@ public void run() {
Thread.sleep((long) (1000 / frequency));

} catch (InterruptedException e) {
e.printStackTrace();
LOG.error("Nasty interrupted exception");
}

repaint();
Expand Down

0 comments on commit 758f8fe

Please sign in to comment.