User 870ab5b546
23-08-2005 12:54:28
Hi,
We have some 3D MOL files that we want to convert into JPEGs with wireframe and white background. Currently they are being converted into ball & stick models with black background, the default. We think the Java code that generates the JPEG is the following:
It seems that the code has the correct parameters set, but they have no effect in the case of the 3D MOL file. Are we doing something wrong? Do we need to use molecule.toBinFormat instead of MolConverter?
We have some 3D MOL files that we want to convert into JPEGs with wireframe and white background. Currently they are being converted into ball & stick models with black background, the default. We think the Java code that generates the JPEG is the following:
Code: |
public static void molToImage(String mol, String imgfile) { try { DataOutputStream op = new DataOutputStream(new FileOutputStream(imgfile)); InputStream ip = new ByteArrayInputStream( mol.getBytes() ); /* Options: width=200 height=80 bg=#b7b7b7 mono H_hetero */ MolConverter mcv = new MolConverter //(ip,op,"jpeg:w247,h150,mono,H_heteroterm",false); (ip,op,"jpeg:scale040,mono,H_heteroterm,wireframe,#ffffff",false); mcv.convert(); op.close(); ip.close(); } catch (FileNotFoundException e1) { e1.printStackTrace(); return; } catch (MolFormatException e2) { System.out.println(" MOLFORMAT EXCEPTION FOR " + mol); e2.printStackTrace(); return; } catch (IOException e3) { e3.printStackTrace(); return; } catch( Exception e4) { e4.printStackTrace(); } } |
It seems that the code has the correct parameters set, but they have no effect in the case of the 3D MOL file. Are we doing something wrong? Do we need to use molecule.toBinFormat instead of MolConverter?