From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer Stengele Subject: Re: insert picture feature request. Date: Wed, 04 May 2011 15:28:46 +0200 Message-ID: <4DC1548E.4080005@diplan.de> References: <20110502132832.GD18788@x201> <697177.63928.qm@web32004.mail.mud.yahoo.com> <4DC12411.6050000@diplan.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHc8J-0003cQ-QO for emacs-orgmode@gnu.org; Wed, 04 May 2011 09:28:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHc8I-0006bV-Cc for emacs-orgmode@gnu.org; Wed, 04 May 2011 09:28:51 -0400 Received: from ns.diplan.de ([212.34.188.4]:47441 helo=mail.diplan.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHc8H-0006b0-UR for emacs-orgmode@gnu.org; Wed, 04 May 2011 09:28:50 -0400 Received: from [192.168.99.164] (stengelepc.diplan.de [192.168.99.164]) by mail.diplan.de (Postfix outbound) with ESMTP id 07B2447E74B for ; Wed, 4 May 2011 15:28:48 +0200 (CEST) In-Reply-To: <4DC12411.6050000@diplan.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Cc: emacs-orgmode@gnu.org Am 04.05.2011 12:01, schrieb Rainer Stengele: > +1 for windows support. > > I would also need such a image copy tool under windows. > > A way to capture an image and have it referenced/included in an org file > with a simple keychord would be most welcome. > > What most of my colleagues - non Emacs users - do is open MS Word, > paste some captured images and write some simple comments. > No need to copy, save and link to an image. > A documentation including some screenshots is done in a snap. > > For me this is one of the things I miss a lot while living in Org. > Anybody knows about a comparable tool to Imagemagick "import" under Windows? > > =============================================================================== > > OK - I searched a bit and found this, which works on command line: (see http://www.irfanview.de) > > > Example for /capture: > i_view32.exe /capture=0 > Capture the whole screen. > i_view32.exe /capture=6 > Start in Capture mode, use last used capture dialog settings. > > capture values: > 0 = whole screen > 1 = current monitor, where mouse is located > 2 = foreground window > 3 = foreground window - client area > 4 = rectangle selection > 5 = object selected with the mouse > 6 = start in capture mode (can't be combined with other commandline options) > > Advanced examples: > i_view32.exe /capture=2 /convert=c:\test.jpg > Capture foreground window and save result as file. > i_view32.exe /capture=2 /convert=c:\capture_$U(%d%m%Y_%H%M%S).jpg > Capture foreground window and save result as file; the file name contains time stamp. > =============================================================================== > > I will try this in my Org environment. > > -- Rainer > > > > Am 04.05.2011 02:37, schrieb Mark S.: >> This doesn't work under windows even if you have ImageMagick installed. Is there a similar way to capture and insert a picture under windows? >> >> Thanks! >> >> --- On Mon, 5/2/11, Russell Adams wrote: >> >>> From: Russell Adams >>> Subject: Re: [O] insert picture feature request. >>> To: emacs-orgmode@gnu.org >>> Date: Monday, May 2, 2011, 6:28 AM >>> On Mon, May 02, 2011 at 02:42:41PM >>> +0200, Piter_ wrote: >>>> Hi all. >>>> I use org-mode for making note while reading >>> articles. >>>> Sometimes I want to insert picture into notes. Now it >>> takes to much >>>> time. I have to copy paste it into picture editor, >>> save it and than >>>> make a link to it. >>>> I would like to do it in other way. Copy picture into >>> clipboard (from >>>> pdf reader for example), and than run a function in >>> emacs which will >>>> ask for file name, save the picture from clipboard >>> into preset folder >>>> and insert link into org file for it. >>>> I have found those links. >>>> http://stackoverflow.com/questions/1868734/how-to-copy-to-clipboard-with-x11 >>>> http://stackoverflow.com/questions/3571179/how-does-x11-clipboard-handle-multiple-data-formats >>>> >>>> About handling clipboard images from python. >>>> I think it is possible to write a simple python script >>> which can save >>>> clipboard picture into file, and than some lisp >>> function which do all >>>> I described above using this script. >>>> Unfortunately I dont know python and lisp on >>> level which allow me to >>>> do it fast end easy. So I ask if someone can do it. I >>> think it would >>>> be useful addition for org-mode. May be even someone >>> have implemented >>>> it, or made another work arround this problem. >>>> Thanks. >>>> Petro. >>>> P.S. Sorry if you get two copies of request. I had >>> some troubles with >>>> sending it and may sent two versions of this mail. >>>> >>> >>> There was a discussion with a working solution not long ago >>> for taking >>> screenshots and inserting them into org automatically. >>> >>> http://comments.gmane.org/gmane.emacs.orgmode/33770 >>> >>> I suspect the code is on worg. >>> >>> Enjoy. >>> >>> ------------------------------------------------------------------ >>> Russell Adams >>> RLAdams@AdamsInfoServ.com >>> >>> PGP Key ID: 0x1160DCB3 >>> http://www.adamsinfoserv.com/ >>> >>> Fingerprint: 1723 D8CA 4280 1EC9 557F >>> 66E8 1154 E018 1160 DCB3 >>> >>> >> >> > > > > The better approach seems to be to take the screenshot image from the clipboard. Therefore any screenshot tool will do. This works for me under Windows XP: (I had to introduce the tilde-buffer-filename variable for irfanview to work) (defun org-screenshot () "Take a screenshot into a time stamped unique-named file in the same directory as the org-buffer and insert a link to this file." (interactive) (setq tilde-buffer-filename (replace-regexp-in-string "/" "\\" (buffer-file-name) t t)) (setq filename (concat (make-temp-name (concat tilde-buffer-filename "_" (format-time-string "%Y%m%d_%H%M%S_")) ) ".jpg")) ;; Linux: ImageMagick: (call-process "import" nil nil nil filename) ;; Windows: Irfanview (call-process "c:\\Programme\\IrfanView\\i_view32.exe" nil nil nil (concat "/clippaste /convert=" filename)) (insert (concat "[[file:" filename "]]")) (org-display-inline-images)) So this is how it works: 1. take a screenshot with any tool you are used to use 2. change to your org buffer and call "org-screenshot" via M-x Instead of ".jpg" you can use any format IrfanView understands, for example "png". Very useful! -- Rainer