ChemAxon 587f88acea
31-08-2004 14:25:54
hello,
I'd like to make files like jpeg or png from a Molecule.
I used toBinFormat(...) and I write the byte[] I get in a file thanks to the java.io.RandomAccessFile and its method write(byte[] b, int off, int len) and write(byte[] b); and here is my problem : the picture I get only contains the first atom of my smiles expression that I used to make the Molecule (I tryed with other smiles).
I join the picture I got.
I think that I missed something but I don't manage to find what... :(
thanks and bye.
I'd like to make files like jpeg or png from a Molecule.
I used toBinFormat(...) and I write the byte[] I get in a file thanks to the java.io.RandomAccessFile and its method write(byte[] b, int off, int len) and write(byte[] b); and here is my problem : the picture I get only contains the first atom of my smiles expression that I used to make the Molecule (I tryed with other smiles).
Code: |
File ftmp = File.createTempFile("mol",".png","./"); RandomAccessFile raf = new RandomAccessFile(ftmp,"rw"); MolHandler mh = new MolHandler("N1C=CC=C1"); Molecule molec = mh.getMolecule(); raf.write(molec.toBinFormat("png:w250,h250,b32,#ededed,wireframe")); raf.close(); |
I join the picture I got.
I think that I missed something but I don't manage to find what... :(
thanks and bye.