Re: [Jmol-users] Capture PNGJ file as a variable

2016-07-17 Thread Robert Hanson
yes, that would work great. JmolData.jar or Jmol.jar can certainly read the PNGJ file and then a write X3D would do the job after that. On Fri, Jul 15, 2016 at 1:35 PM, Chris St Pourcain < chrisstpourc...@indigomolecularimages.com> wrote: > > Thanks for all your suggestions with this. I' haven't

Re: [Jmol-users] Capture PNGJ file as a variable

2016-07-15 Thread Chris St Pourcain
Thanks for all your suggestions with this. I' haven't had a chance to try them out yet. The reason I asked the question is because I wanted to send the PNGJ file via AJAX. At the moment to create photo-realistic images from JSmol the browser generates an .x3d file of the molecule and we then send

Re: [Jmol-users] Capture PNGJ file as a variable

2016-07-15 Thread Otis Rothenberger
Angel, I thought that Chris might have dynamic Jmol image insertion into a Web Page in mind. Jaime, this is not quite the same as preloading images in JavaScript. I do this with Jmol jpeg's because they are already in text (base64) format. Base64 images are easily reduced in size if needed, and

Re: [Jmol-users] Capture PNGJ file as a variable

2016-07-15 Thread Jaime Prilusky
This should be the same as using preloaded images with javascript. Jaim > On 15 Jul 2016, at 11:51 AM, Angel Herráez wrote: > > El 14 Jul 2016 a las 12:13, Robert Hanson escribió: >> Note that by putting a PNGJ file into a variable you can >> >> -- extract or exchange the image > > So a questi

Re: [Jmol-users] Capture PNGJ file as a variable

2016-07-15 Thread Angel Herráez
El 14 Jul 2016 a las 12:13, Robert Hanson escribió: > Note that by putting a PNGJ file into a variable you can > > -- extract or exchange the image So a question would be, How to apply that extracted image in the page, e.g. as the source of an tag created dynamically in Javascript? --

Re: [Jmol-users] Capture PNGJ file as a variable

2016-07-14 Thread Robert Hanson
Note that by putting a PNGJ file into a variable you can -- retrieve the original model -- extract or change the state script file -- extract or exchange the image -- save it as a ZIP file This is because it is simply an associative array with various key/value pairs. Same thing can be done with

Re: [Jmol-users] Capture PNGJ file as a variable

2016-07-14 Thread Otis Rothenberger
Chris, I have a quick follow-up curiosity question after Bob and Angel's replies. In your original note, you seemed to want to hold this information in JavaScript variables. Was there a particular reason that you wanted to do this? Otis --Otis rothenbergero...@chemagic.org http://chemagic

Re: [Jmol-users] Capture PNGJ file as a variable

2016-07-14 Thread Robert Hanson
x = write("PNGJ") works fine, but since it is binary (a zip file) $ load $caffeine C8H10N4O2 $ x = write("PNGJ") $ print x.length $ print x.type hash $ print x.keys $_BINARY_$ JmolManifest.txt Jmol_version_14.6.1_2016.07.11__2016-07-11_18.22 _IMAGE_ _LEN_ https___cactus.nci.nih.gov_chemical_stru

Re: [Jmol-users] Capture PNGJ file as a variable

2016-07-14 Thread Angel Herráez
Chirs, please hav a look at "getProperty image" under http://chemapps.stolaf.edu/jmol/docs/?ver=14.6#getproperty It's only defined as JPEG but does the trick · Dr. Angel Herráez Biochemistry and Molecular Biology, Dept. of Systems Biology, University of Alcalá E-28871 Alcalá de Henares (Madri

Re: [Jmol-users] Capture PNGJ file as a variable

2016-07-14 Thread Angel Herráez
Chris, the problem is possibly that PNG data is binary, while X3D data is text I am not sure you can put binary data in a javascript variable. So the limitation might be in the js side rather than the Jmol side. -- W