Convert molecule source into an image and display on page

User 478d103dc9

12-04-2013 13:19:38

  I’m using below code in “Marvin for
JavaScript” to convert mol into an image and then importing it into the
container element(imageContainer). What would be the equivalent code to do it for
 MarvinSketch?


  


function displayImage(visible) {


     var settings = {


        'width':
390,


        'height':
60


   
};


     var dataUrl =
sketchFrame.contentWindow.marvin.ImageExporter.molToDataUrl(strMol,
"image/png", settings);


   
document.getElementById("image").setAttribute("src", dataUrl);


     var pict = document.getElementById("imageContainer");


   
pict.style.display = (visible) ? "inherit"
: "none";


}


 


Thanks

ChemAxon 2c555f5717

15-04-2013 09:24:46

Dear Access!


   Unfortunatelly there is no working solution for this currently, but we consider to implement this feature.


Regards:
Balázs 

User 870ab5b546

16-04-2013 13:31:37

Can you not display the molecule within MarvinView instead of displaying its image?

User 478d103dc9

16-04-2013 14:19:00










bobgr wrote:

Can you not display the molecule within MarvinView instead of displaying its image?



 


 


Hi,


I have MarvinSketch in popup page and want to
import the "image" into main page upon closing the sketcher.


Any code sample how would I do it with
MarvinVIew?


Thanks


 


 

ChemAxon 2c555f5717

17-04-2013 05:55:51

Dear Access!


You can get the molecule with getMol(format) function. You can set this molecule string to a View with setMol(String) method. This is an easy way to have an interactive molecule representation on your page. You can read more on settings of Marvin View Applet to costumize it for your needs.


Regards:
Balázs