[Offtopic] Drawing to a BufferedImage from EMF with FreeHEP

User 366e966a35

04-02-2011 13:05:14

Hello!


Because MarvinSketch uses FreeHEP internally and FreeHEP forums are currently offline, I'd like to ask help here.


How can I draw an EMF file to a BufferedImage of predefined size? As for now I succeeded with drawing arbitrary EMF image to a BufferedImage, but EMF renderer doesn't respect dimension (width and height) of provided BufferedImage instance. How can I force it to draw image of particular size, not the size that EMF renderer considers right (default).


A snippet of code will be highly appreciated.


Thank you in advance!

ChemAxon 7c2d26e5cf

04-02-2011 16:51:01

When I implemented Freehep based EMF export in Marvin. I did not use BufferedImage.


I have used EMFGraphics2D(OutputStream, Dimension) constructor to create graphics for drawing.


We have used Freehep only for EMF and PDF export. We did not deal with visualization of existing EMF file.


I am afraid I can not help you.


Anyway, it is out of our scope. We provide support only for ChemAxon products.