Black background image of the structure

User 82b20b535e

23-08-2016 18:25:45

Hi,


I retrieve the Image for a given structure and saved it in a file and image background has a black color.  Below is my code to retrieve the image and when I save the structure I see the black background image.  What am I missing here ?


IJChemMolecule molecule = MainFactory.Chemistry.CreateMolecule(structure, MoleculeFormat.MRV);


imagestructure = molecule.Renderer.RenderToImage(ImageFormat.Emf);


parameter structure is a string which will is "<?xml version="1.0" encoding="windows-1252"?><cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com/marvin/schema/mrvSchema_14_12_01.xsd" version="ChemAxon file format v14.12.01, generated by v15.6.22.0"> <MDocument><MChemicalStruct><molecule molID="m1"><atomArray atomID="a1 a2 a3 a4 a5" elementType="N C C C C" x2="-12.208333015441895 -10.962446844104475 -11.438333015441893 -12.978333015441894 -13.454219186779314" y2="9.476669229420247 8.571479940889839 7.106852905795303 7.106852905795302 8.571479940889837"></atomArray><bondArray><bond id="b1" atomRefs2="a1 a2" order="1"></bond><bond id="b2" atomRefs2="a2 a3" order="2"></bond><bond id="b3" atomRefs2="a4 a5" order="2"></bond><bond id="b4" atomRefs2="a1 a5" order="1"></bond><bond id="b5" atomRefs2="a3 a4" order="1"></bond></bondArray></molecule></MChemicalStruct></MDocument> </cml>"

ChemAxon 2e7d8629fa

24-08-2016 09:36:19

 Hi,


 


Before render the molecule to a file please set the trancparency to False.


molecule.Renderer.Settings.DrawingInfo.Transparent = false;


molecule.Renderer.RenderToFile(jpgFilePath, ImageFormat.Jpeg);


 


I hope it helps.


 


Regards,


Gergely

User 82b20b535e

24-08-2016 12:18:16










gkovacs wrote:

 Hi,


 


Before render the molecule to a file please set the trancparency to False.


molecule.Renderer.Settings.DrawingInfo.Transparent = false;


molecule.Renderer.RenderToFile(jpgFilePath, ImageFormat.Jpeg);


 


I hope it helps.


 


Regards,


Gergely



Thanks that resolved the issue.