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.
- fps=15;
- cam = Camera.getCamera();
- for (w=100;w<1000;w=w+20){
- for (h=100;h<1000;h=h+20){
- cam.setMode(w,h,fps);
- if ((w cam.width ) && (h cam.height)){
- trace( w + " x " + h + " @ " + cam.fps);
- }
- }

RSS Feed