コード例 #1
0
 public void draw() {
   if (cam.available()) {
     cam.read();
     image(cam, 0, 0);
     text("Click to upload to Flickr", 10, height - 13);
   }
   fill(255, 0, 0);
   rect(0, 0, 25, 25);
 }
コード例 #2
0
  public void setup() {
    size(320, 240);

    String[] devices = Capture.list();
    println(devices);
    // Set up the camera.
    //  cam = new Capture(this, 320, 240);
    cam = new Capture(this, width, height, devices[10]);

    // cam.start();
    // Set up Flickr.
    flickr = new Flickr(apiKey, secretKey, (new Flickr(apiKey)).getTransport());

    // Authentication is the hard part.
    // If you're authenticating for the first time, this will open up
    // a web browser with Flickr's authentication web page and ask you to
    // give the app permission. You'll have 15 seconds to do this before the Processing app
    // gives up waiting fr you.

    // After the initial authentication, your info will be saved locally in a text file,
    // so you shouldn't have to go through the authentication song and dance more than once
    authenticate();

    // Create an uploader
    uploader = flickr.getUploader();
  }