Hi all,
I would like to have the applet background automatically changed to 
white when a user snaps an image, and I have been toying around with 
the following code:

function snapJmolImage (){
jmolScript("color background white");
var  myImage = jmolGetPropertyAsString("image");
document.getElementById("SnpSht").innerHTML = '<img 
style="float:right" width="300" height="300" 
src="data:image/jpeg;base64,' + myImage + '">';
jmolScript("color background black");
}

All works well, except that the snapshot always appears with a black 
background (although I can see a white flash). It seems that 
jmolGetPropertyAsString("image") fires before the color change -- 
even if I build in a delay such as:
setTimeout(myImage = jmolGetPropertyAsString("image"),10000);
or
jmolScript("color background white; delay 5");

I'm using jmol-11-6-RC12.
Is there a solution?
Steve



Dr. Steven R. Spilatro
Department of Biology and Environmental Science
Marietta College


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to