Technical Support Forum Index
Technical Support Forum
Access ChemAxon scientists and developers here. For registration and login issues contact website support.

Support Ticket System is replacing forum

This forum was converted into a searchable archive. You cannot add posts here any more. For support please use our new Ticket System.

Create your first ticket
Black background image of the structure
To watch this topic for replies  Register (enables digests) or give email address:
This topic is locked: you cannot edit posts or make replies.
Display posts from previous:   
    View previous topic :: View next topic    
Author Message
Dhananjaya

Joined: 09 Jul 2014
Posts: 68

View user's profile

Back to top
Link to postPosted: Tue Aug 23, 2016 7:25 pmPost subject: Black background image of the structure Reply with quote

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>"

gkovacs
ChemAxon personnel
Joined: 06 Oct 2011
Posts: 57

View user's profile

Back to top
Link to postPosted: Wed Aug 24, 2016 10:36 amPost subject: Reply with quote

 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

Dhananjaya

Joined: 09 Jul 2014
Posts: 68

View user's profile

Back to top
Link to postPosted: Wed Aug 24, 2016 1:18 pmPost subject: Reply with quote

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.

This topic is locked: you cannot edit posts or make replies.
Page 1 of 1


To watch this topic for replies   Register (enables digests) or give email address  
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum