Yes, but you  can't just output raw bytes to system out. Best way, if it
will work for you, is to write them to a temporary file and then read that.
If you had a separate Java program that was using Jmol as a library, then
you could call methods in Jmol that would deliver the raw image bytes. Note
that you do not have to actually have a graphics display to do this; you
can do it with JmolData.jar instead of Jmol.jar and save some overhead,
since JmolData.jar has no display. The format for that is something like
this:

java -Xmx2048m -jar /Jmol/JmolData.jar -nj "load '/testSet/dna-a.pse'
filter 'DORESIZE;DOCACHE';" -g0x0 -w 'PNGJ:/testSet/dna-a/jmol.png';

That is a bit more than you need. This particular example is especially
tuned to PyMOL session file reading (DORESIZE and g0x0 indicating that we
want to generate the exact image size saved in the PyMOL session; DOCACHE
indicates that we want to cache structures in the output file for fast
regeneration.

"PNGJ" creates more than you need - an image with complete ZIP file
appended that allows the image itself to be used to recreate the model and
the "image" file to also be extractable using 7zip. Doesn't sound like you
need that. So just leave that out. You will need something like this:

java -Xmx2048m -jar /Jmol/JmolData.jar -nj "load '/testSet/x.mol' "
-g500x500 -w '/testSet/dna-a/jmol.png';

If you know specifically how to output bytes to the output stream, let me
know, and I could create a command line option for that, perhaps.

Bob




On Fri, May 24, 2013 at 1:30 PM, Roshan Punnoose <[email protected]> wrote:

> Hi,
>
> I want to use Jmol internally to read a mol file string and retrieve the
> image created as bytes. Is this possible?
>
> Roshan
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
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
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to