Sorry -- what should I do with this patch?  It's not clear to me.

Thanks 

Sam

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Won Kyu
Park
Sent: Sunday, July 03, 2005 2:28 PM
To: [email protected]
Subject: Re: [Jmol-developers] making an image file in jmol

On Sun, Jul 03, 2005 at 10:42:10AM -0400, timothy driscoll wrote:
> On 2005-07-03 (07:52) Miguel wrote:
> <snip>
> >>Is it possible to somehow generate an image file from the jmol
> >>viewer?
> >
> >The Jmol application is capable of generating .jpg images
> >
> >>Visitors to my site can view their protein and highlight various
> >>residues. However some people will want to use the animation in a
> >>powerpoint slide. I could generate gif's using VMD, but it would be
> >>so much more elegant if the very image they see in jmol could be put
> >>into a file..
> >

to paste the jmol images in a powerpoint is more simply implemented
by the Clipboard feature in the Java

I have a patch to use a clipboard with a keyListener patch.
and it works fine for me

http://chem.skku.ac.kr/~wkpark/chem/jmol-cvs.patch

http://chemie.skku.ac.kr/jmol.html

click the applet with mouse and press 'Y' to copy the shot of the applet
and <Ctrl>-V in the Powerpoint or whatever you want to insert in.

----------- Jmol.java
...
  // This class is used to hold an image while on the clipboard.
  public class ImageSelection implements Transferable {
    private Image image;

    public DataFlavor imageFlavor;

    public ImageSelection(Image image) {
      this.image = image;
      // hack in order to be able to compile in java1.3
      imageFlavor =
                new DataFlavor("image/x-java-image; class=java.awt.Image",
                   "Image");
    }

    // Returns supported flavors
    public DataFlavor[] getTransferDataFlavors() {
      return new DataFlavor[]{imageFlavor};
    }
    
    // Returns true if flavor is supported
    public boolean isDataFlavorSupported(DataFlavor flavor) {
      return flavor.equals(imageFlavor);
    }
    
    // Returns image
    public Object getTransferData(DataFlavor flavor) throws
UnsupportedFlavorException, IOException {
      if (!flavor.equals(imageFlavor)) {
        throw new UnsupportedFlavorException(flavor);
      }
      return image;
    }
  }
...

  public void keyTyped(KeyEvent e)
  {
    char keyChar = e.getKeyChar();
    if (keyChar == 'h' || keyChar == 'H') {
       System.err.println("oops");
       return;
    }
    if (keyChar == KeyEvent.CHAR_UNDEFINED)
       return;
    switch(keyChar) {
...
    case 'y':
    case 'Y':
       Dimension size = jvm12orGreater ? jvm12.getSize() :
appletWrapper.size();
       Image image=appletWrapper.createImage(size.width,size.height);
       Graphics gg=image.getGraphics();
       viewer.setScreenDimension(size);
       Rectangle rectClip =
         jvm12orGreater ? jvm12.getClipBounds(gg) : gg.getClipRect();
       
       viewer.renderScreenImage(gg, size, rectClip);
       ImageSelection imgSel = new ImageSelection(image);
       Toolkit.getDefaultToolkit().getSystemClipboard().setContents(imgSel,
null);
       break;
...
-------


> <snip>
> >I suggest that you fill out a bug report as a feature request. But
> >don't expect it to be implemented any time soon.
> >
> 
> in the meantime:
> 
> 1. simple screen capture programs are a dime a dozen these days, and have
served me well enough for low-res images. OSX has nice built-in capture
functionality (look in System Preferences:Keyboard:Shortcuts).
> 
> 2. there is also software to capture an actual animation from a Web page,
with varying degrees of success.  SnapZ Pro comes to mind
(<http://www.ambrosiasw.com/utilities/snapzprox/>) but it might be OSX-only.
and of course, any software like this requires user involvement for
installation, etc.  you can Google for "screen capture animations".
> 
> 3. Re PowerPoint in particular, check out this Jmol users list thread:
<http://sourceforge.net/mailarchive/message.php?msg_id=11843977>  it might
give you ideas...
> 
> 
> 
> regards,
> 
> tim
> -- 
> Timothy Driscoll
> molvisions - see, grasp, learn.
> <http://www.molvisions.com/>
> usa:north carolina:raleigh
> 
> "I've had a perfectly wonderful evening. But this wasn't it." - Groucho
Marx
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op?k
> _______________________________________________
> Jmol-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-developers


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to