emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer Stengele <rainer.stengele@online.de>
To: Medhat Essmat <e.medhat@ieee.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Help, I need to paste raw image from clipboard into emacs/orgmode
Date: Sun, 24 Jul 2011 22:11:10 +0200	[thread overview]
Message-ID: <4E2C7C5E.9020307@online.de> (raw)
In-Reply-To: <CAJtN4LBaMR4o38=FyHsn1kku0WfS+qofcqdh+qXBuz3xQn7vBA@mail.gmail.com>

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

  parent reply	other threads:[~2011-07-24 20:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-20 14:59 Help, I need to paste raw image from clipboard into emacs/orgmode Medhat Essmat
2011-07-24 18:26 ` suvayu ali
2011-07-24 20:11 ` Rainer Stengele [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-06-06 17:16 Klaus-Dieter Bauer
2013-06-07  9:31 ` Vitalie Spinu
2013-06-07 18:15   ` Klaus-Dieter Bauer
2013-11-06 15:28     ` Alexander Vorobiev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E2C7C5E.9020307@online.de \
    --to=rainer.stengele@online.de \
    --cc=e.medhat@ieee.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).