[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Help, I need to paste raw image from clipboard into emacs/orgmod
From: |
Rainer Stengele |
Subject: |
Re: [O] Help, I need to paste raw image from clipboard into emacs/orgmode |
Date: |
Sun, 24 Jul 2011 22:11:10 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20110624 Thunderbird/5.0 |
Am 20.07.2011 16:59, schrieb Medhat Essmat:
> Dear All,
>
> Please Help,
>
> I need to paste raw image from clipboard into emacs/orgmode, I am a microsoft
> onenote user and I got used to take a lot of snapshots and embed it into my
> notes, I think if I could know how to embed images directly into
> emacs/orgmode from clipboard, I will switch to emacs very easily.
>
>
> I searched the internet but unfortunately I didn't find the answer,
>
> Thanks a lot.
> Dodo
Dear Dodo,
check this for Windows:
---------------------------------------------------------------------------------------------------------------
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
---------------------------------------------------------------------------------------------------------------
Check the corrsponding gmane thread with subject "insert picture feature
request."
-- Rainer