Ketai Camera very small display

edited July 2016 in Android Mode

Hi everyone, I´m starting to use the ketai 'CameraGettingStarted' example. I can compile it well and run on my device, but the image display is a square very small. I only change the Image parameter this is the code. Thanks in advance:

/** *

Ketai Sensor Library for Android: http://KetaiProject.org

* *

<

p>Ketai Camera Features: *

    *
  • Interface for built-in camera
  • *
  • TODO: fix HACK of camera registration that currently exceptions in setup() at the moment.
  • *
  • Updated: 2012-10-21 Daniel Sauter/j.duran

    */

import ketai.camera.*;

KetaiCamera cam;

void setup() { orientation(LANDSCAPE); imageMode(CENTER); textSize(45); }

void draw() {

if(cam != null && cam.isStarted()) image(cam, 0,0); else { background(128); text("touch to activate", 100, height/2); } }

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

// start/stop camera preview by tapping the screen void mousePressed() { //HACK: Instantiate camera once we are in the sketch itself if(cam == null) cam = new KetaiCamera(this, 640, 480, 24);

if (cam.isStarted()) { cam.stop(); } else cam.start(); } void keyPressed() { if(cam == null) return;

if (key == CODED) { if (keyCode == MENU) { if (cam.isFlashEnabled()) cam.disableFlash(); else cam.enableFlash(); } } }

Tagged:

Answers

  • edited July 2016

    @MiniRo===

    • format your code

    • of course your image is small because you never set sketch size()

    • add void settings{ size(800,600); }

Sign In or Register to comment.