User 93ffa33d02
29-03-2014 11:58:40
Hello, I am using your sample code for hit alignment coloring.
private void run() throws Exception {
Molecule query = MolImporter.importMol(QUERY);
Molecule target = MolImporter.importMol(TARGET);
Molecule display = getDisplayMol(query, target, getDisplayOptions());
DisplayUtil.showMolecule(query, 0, "Query");
DisplayUtil.showMolecule(target, 1, "Target");
DisplayUtil.showMolecule(display, 2, "Colored target");
}
In the opened JFrame there are visible nice coloring of red and green for the display molecule.
The problem is that I cannot figure out how to transform display molecule into image (jpeg) file that would still contain red and green coloring.
If I use MolExporter methods exportToBinFormat or exportToObject, I get black and white image of the display molecule. Is there a way to get image with hit coloring?
byte[] d4 = (byte[])MolExporter.exportToObject(display, "jpeg:w300,h300");
FileOutputStream fos = new FileOutputStream(path);
fos.write(d4);
fos.close();