Hi Viktor Thanks for all you help in this matter, I managed to make it work and can search/read/write/update my structures in the database using the latest version.
I am struggelig with one point, which is most likely the most asked question: Rendering structure images.
I can create images from my structures, but they all seem to end up with a black background, even though I am specifically setting the back-color to a different one.
Code snippet:
public void SavetStructureImage(int width, int heigth, string backcolor, string savepath, string savename) {
Image img = null;
MoleculeData molData = new MoleculeData(this.molFile, ChemAxon.NET.Base.Chemistry.Formats.MoleculeFormat.SMILES);
JChemMolecule molecule = new JChemMolecule(molData);
bool isempty = molecule.IsEmpty;
if (molecule != null && !molecule.IsEmpty) {
molecule.Renderer.Settings.DrawingInfo.BackgroundColor = Color.White;
molecule.Renderer.Settings.DrawingInfo.Size = new Size(width, heigth);
try {
DirectoryInfo dir = new DirectoryInfo(savepath);
if (!dir.Exists)
dir.Create();
//Save to disk.
molecule.Renderer.RenderToFile(savepath + savename, ImageFormat.Jpeg);
}
catch {
}
}
}
this.molfile: This is the value from the cd_smiles col in the db. Example:
O.Cc1ccc(cc1)S(O)(=O)=O
Any suggestions about what I am doing wrong..?