offscreen camera doesn't work ?
in
Android Processing
•
7 months ago
hi all.
maybe this is a bug:
I would like to loadPixels from ketai camera without showing it- But it seems to be a problem to connect the camera without showing it. could you reproduce this bug ?
it gives me:
maybe this is a bug:
I would like to loadPixels from ketai camera without showing it- But it seems to be a problem to connect the camera without showing it. could you reproduce this bug ?
it gives me:
Exception caught while trying to connect to camera service. Please check your sketch permissions or that another application is not using the camera.
- /**
* <p>Ketai Sensor Library for Android: http://KetaiProject.org</p>
*
* <p>Ketai Camera Features:
* <ul>
* <li>Interface for built-in camera</li>
* <li></li>
* </ul>
* <p>Updated: 2012-03-10 Daniel Sauter/j.duran</p>
*/
import ketai.camera.*;
KetaiCamera cam;
void setup() {
orientation(PORTRAIT);
cam = new KetaiCamera(this, 1280, 800, 60);
}
void draw() {
//image(cam, 0, 0); //this is the source of the problem
}
void onPause()
{
super.onPause();
//Make sure to releae the camera when we go
// to sleep otherwise it stays locked
if (cam != null && cam.isStarted())
cam.stop();
}
void onCameraPreviewEvent()
{
cam.read();
// cam.autoSettings();
}
void exit() {
cam.stop();
}
// start/stop camera preview by tapping the screen
void mousePressed()
{
if (cam.isStarted())
{
cam.stop();
}
else
cam.start();
}
void keyPressed() {
if (key == CODED) {
if (keyCode == MENU) {
if (cam.isFlashEnabled())
cam.disableFlash();
else
cam.enableFlash();
}
}
}
{
}
1