Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

Can't access camera

$
0
0

Here's a sketch I'm trying to run, pretty similar to the CameraGettingStarted sketch by Ketai:

import ketai.camera.*;

color chosenColor;

KetaiCamera cam;

void setup () {
  orientation(PORTRAIT);
  size(displayWidth, displayHeight);
  imageMode(CENTER);
  cam = new KetaiCamera(this, width, height, 24);

}

void draw () {
  image(cam, width/2, height/2);
}

void onCameraPreviewEvent () {
  cam.read();
}

void mousePressed () {
   if(cam.isStarted()) {
    cam.stop();
   }
  else {
    cam.start();
  }
}

For whatever reason, the CameraGettingStarted sketch requests access to the camera and works perfectly. This sketch does not. What am I doing wrong?


Viewing all articles
Browse latest Browse all 941

Trending Articles