[AS3 SNIPPET] Webcam supported modes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | function webcamSupportedModes(minW:Number, minH:Number, maxW:Number, maxH:Number, fps:Number, step:uint = 20) { var cam:Camera = Camera.getCamera(); for (var w:uint = minW; w < maxW + 1; w = w + step) { for (var h:uint = minH; h < maxH + 1; h = h + step) { cam.setMode(w, h, fps); if (w == cam.width && h == cam.height) { trace(cam.width + " x " + cam.height + " @ " + cam.fps); } } } } webcamSupportedModes(320, 240, 1280, 1024, 30, 100); |
nice one Riccardo, thanks for sharing!