From: Samuel F. <sam...@ya...> - 2005-07-03 19:01:48
|
Sorry -- what should I do with this patch? It's not clear to me. Thanks=20 Sam -----Original Message----- From: jmo...@li... [mailto:jmo...@li...] On Behalf Of Won = Kyu Park Sent: Sunday, July 03, 2005 2:28 PM To: jmo...@li... 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 =3D image; // hack in order to be able to compile in java1.3 imageFlavor =3D new DataFlavor("image/x-java-image; class=3Djava.awt.Image", "Image"); } // Returns supported flavors public DataFlavor[] getTransferDataFlavors() { return new DataFlavor[]{imageFlavor}; } =20 // Returns true if flavor is supported public boolean isDataFlavorSupported(DataFlavor flavor) { return flavor.equals(imageFlavor); } =20 // 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 =3D e.getKeyChar(); if (keyChar =3D=3D 'h' || keyChar =3D=3D 'H') { System.err.println("oops"); return; } if (keyChar =3D=3D KeyEvent.CHAR_UNDEFINED) return; switch(keyChar) { ... case 'y': case 'Y': Dimension size =3D jvm12orGreater ? jvm12.getSize() : appletWrapper.size(); Image image=3DappletWrapper.createImage(size.width,size.height); Graphics gg=3Dimage.getGraphics(); viewer.setScreenDimension(size); Rectangle rectClip =3D jvm12orGreater ? jvm12.getClipBounds(gg) : gg.getClipRect(); =20 viewer.renderScreenImage(gg, size, rectClip); ImageSelection imgSel =3D 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. > > >=20 > in the meantime: >=20 > 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). >=20 > 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". >=20 > 3. Re PowerPoint in particular, check out this Jmol users list thread: <http://sourceforge.net/mailarchive/message.php?msg_id=3D11843977> it = might give you ideas... >=20 >=20 >=20 > regards, >=20 > tim > --=20 > Timothy Driscoll > molvisions - see, grasp, learn. > <http://www.molvisions.com/> > usa:north carolina:raleigh >=20 > "I've had a perfectly wonderful evening. But this wasn't it." - = Groucho Marx >=20 >=20 > ------------------------------------------------------- > 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_id=16492&op?k > _______________________________________________ > Jmol-developers mailing list > Jmo...@li... > 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_id=16492&op=3Dick _______________________________________________ Jmol-developers mailing list Jmo...@li... https://lists.sourceforge.net/lists/listinfo/jmol-developers |