Well, if you want, give it a try. You will have to use the latest version of
Jmol -- http://chemapps.stolaf.edu/jmol/docs/examples-11/JmolApplet.jar

Just issue

var x = jmolGetPropertyAsJavaObject("image")

That "AsJavaObject" ensures that the image created is returned as a byte
array -- the actual JPEG code -- rather than as a Base64-encoded string.
That return value is a Java byte[] object, not a JavaScript object. There is
no such thing as a "byte array" in JavaScript.

Good luck!

Bob



On Tue, Sep 9, 2008 at 4:01 PM, Steven R. Spilatro <[EMAIL PROTECTED]>wrote:

> Bob,
> Well, I'm not sure...  In the demo web page I sent earlier I assign
> the base64-encoded Jmol image, to a image element in the same page:
> var jmlImgB64 = jmolGetPropertyAsString('image');
> document.getElementById("jmlImage").innerHTML = '<img
> width="'+imgWd+'" height="'+imgHt+'" src="data:image/jpeg;base64,' +
> jmlImgB64 + '">';
>
> I'm wondering if Jmol could deliver a non-base64 encoded image (e.g.,
> jpg) that could be assigned to a image element in a similar way? (and
> therefore eliminate the need for php decoding!)
> Steve
>
>
>
> >The feature just doesn't exist for browsers. You can set a JavaScript
> >variable to any memory-constrained length, but you are asking for
> something
> >different, I think.
> >
> >Bob
> >
> > > > Would a feature like "testimg.src=jmolGetImage ("jpeg")" involve
> > > > similar contraints?
> > > > 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

Reply via email to