List of utility methods to do Image Save
void | write(Image image, ImageOutputStream ios, ImageWriter writer) write writer.setOutput(ios);
ImageWriteParam pm = writer.getDefaultWriteParam();
RenderedImage renderedImage = toBufferedImage(image);
pm.setSourceRegion(new Rectangle(0, 0, renderedImage.getWidth(), renderedImage.getHeight()));
writer.write(renderedImage);
|
boolean | writeImageIconToFile(ImageIcon icon, String imageType, File targetFile) Writes the given image icon to the given file in the given imageType. try { BufferedImage iconimage = new BufferedImage(icon.getIconWidth(), icon.getIconWidth(), BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = iconimage.createGraphics(); icon.paintIcon(null, g2, 0, 0); g2.dispose(); ImageIO.write(iconimage, imageType, targetFile); } catch (Exception e) { ... |
void | writeImageToBlob(int column, PreparedStatement psmt, Image image) write Image To Blob ImageIcon icon = null; if (image != null) { icon = new ImageIcon(image); writeToBlob(column, psmt, imageToBytes(icon)); |