@Override public void flush() throws IOException { if (outputStream != null) { outputStream.flush(); } }
@Override public void close() throws IOException { if (outputStream != null) { outputStream.flush(); outputStream.close(); outputStream = null; } if (imageWriter != null) { imageWriter.dispose(); imageWriter = null; } }
targetWriter.write(null, jimg, writeParams); out.flush(); out.close();
targetWriter.write(null, jimg, writeParams); out.flush(); out.close();
IIOImage image = new IIOImage(dest, null, null); writer.write(null, image, params); toFs.flush();
public void createImage(String format, int style, float size, String out, Color bg, Color fg, boolean transparency) { TeXIcon icon = createTeXIcon(style, size); icon.setInsets(new Insets(1, 1, 1, 1)); int w = icon.getIconWidth(), h = icon.getIconHeight(); BufferedImage image = new BufferedImage(w, h, transparency ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB); Graphics2D g2 = image.createGraphics(); if (bg != null && !transparency) { g2.setColor(bg); g2.fillRect(0, 0, w, h); } icon.setForeground(fg); icon.paintIcon(null, g2, 0, 0); try { FileImageOutputStream imout = new FileImageOutputStream(new File(out)); ImageIO.write(image, format, imout); imout.flush(); imout.close(); } catch (IOException ex) { System.err.println("I/O error : Cannot generate " + out); } g2.dispose(); }
IIOImage image = new IIOImage(dest, null, null); writer.write(null, image, params); toFs.flush();
IIOImage image = new IIOImage(dest, null, null); writer.write(null, image, params); toFs.flush(); toFs.close();
imgWrtr.write(null, image, imgWrtrPrm); imgWrtr.dispose(); output.flush(); output.close(); scaledImage = null;