Note that MSIE (6 at least) does not support <img src="data:...">
http://en.wikipedia.org/wiki/Data:_URI_scheme
Use
jmolScriptWait("color background white");
here and you should be OK. The problem is that jmolScript() works
"asynchronously" -- you are passing the command to Jmol and saying, "Do this
at the next available opportunity."
Bob
On Fri, Sep 5, 2008 at 3:25 PM, Steven R. Spilatro <[EMAIL PROTECTED]>wrote:
> 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
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
-------------------------------------------------------------------------
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