FreeHEP seems to work quite well, although it does not seem to be supported anymore, and its error and forum pages have disappeared. With just a few lines, you get a pop-up dialog box that can save any component in various scalable and conventional image formats. We have several complex images using alpha channel, rotated text, areas bounded by curves, and they are saved perfectly, much better with VectorGraphics2D.
The only problem I've seen so far is jpeg save, which comes out black for all my images. This is not very important for us, given that png works, plus all vector modes, but I'm sure this will be a problem for some.
I had to add this particular code to save in all of these modes:
public static void showImage(Component comp) { try { ExportDialog export = new ExportDialog(); export.showExportDialog( null, "Export view as ...", comp, "export" ); System.err.println("Image save complete"); } catch(Exception e) { e.printStackTrace(); } }
There are tons of libraries that should also be added.
source share