I recently ended up having to find what webcam modes were supported by a webcam. The following code can be used to find out what’s available..

It turned out that my problem wasn’t anything to do with modes, which is why I didn’t expand this further – had I done, I would’ve stored an array of modes I supported, and checked to see if I had a match.

  1. fps=15;
  2. cam = Camera.getCamera();
  3. for (w=100;w<1000;w=w+20){
  4. for (h=100;h<1000;h=h+20){
  5. cam.setMode(w,h,fps);
  6. if ((w cam.width ) &amp;&amp; (h cam.height)){
  7. trace( w + " x " + h + " @ " + cam.fps);
  8. }
  9. }