/** Gets width and height for the given PICT bytes. */ public Dimension getPictDimensions(byte[] bytes) throws FormatException, ReflectException { checkQTLibrary(); try { r.exec("QTSession.open()"); r.setVar("bytes", bytes); r.exec("pict = new Pict(bytes)"); r.exec("box = pict.getPictFrame()"); int width = ((Integer) r.exec("box.getWidth()")).intValue(); int height = ((Integer) r.exec("box.getHeight()")).intValue(); r.exec("QTSession.close()"); return new Dimension(width, height); } catch (ReflectException e) { r.exec("QTSession.close()"); throw new FormatException("PICT height determination failed", e); } }
/** Gets width and height for the given PICT bytes. */ public Dimension getPictDimensions(byte[] bytes) throws FormatException, ReflectException { checkQTLibrary(); try { r.exec("QTSession.open()"); r.setVar("bytes", bytes); r.exec("pict = new Pict(bytes)"); r.exec("box = pict.getPictFrame()"); int width = ((Integer) r.exec("box.getWidth()")).intValue(); int height = ((Integer) r.exec("box.getHeight()")).intValue(); r.exec("QTSession.close()"); return new Dimension(width, height); } catch (ReflectException e) { r.exec("QTSession.close()"); throw new FormatException("PICT height determination failed", e); } }
r = tools.getUniverse(); tools.checkQTLibrary();
r = tools.getUniverse(); tools.checkQTLibrary();
throws FormatException checkQTLibrary(); try { r.exec("QTSession.open()");
throws FormatException checkQTLibrary(); try { r.exec("QTSession.open()");
r = tools.getUniverse(); tools.checkQTLibrary();
r = tools.getUniverse(); tools.checkQTLibrary();