From c6e051a81877f5729907c54780720aec52c96b27 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Mon, 4 Jun 2012 18:26:00 +0000 Subject: [PATCH] Prints available resolutions in error message... --- java/libraries/video/src/processing/video/Capture.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java/libraries/video/src/processing/video/Capture.java b/java/libraries/video/src/processing/video/Capture.java index 7b86d55e9..8134070db 100644 --- a/java/libraries/video/src/processing/video/Capture.java +++ b/java/libraries/video/src/processing/video/Capture.java @@ -703,9 +703,13 @@ public class Capture extends PImage implements PConstants { if (!fps.equals("")) { fpsStr = ", " + fps + "fps"; } + String helpStr = "Use one of the following resolutions instead:\n"; + for (int i = 0; i < resolutions.size(); i++) { + Resolution res = resolutions.get(i); + helpStr += res.toString() + '\n'; + } throw new RuntimeException("The requested resolution of " + reqWidth + "x" + reqHeight + fpsStr + - " is not supported by the selected capture device. " + - "Get list of supported resolutions with the resolutions() method."); + " is not supported by the selected capture device.\n" + helpStr); } }