emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Mark S." <throaway@yahoo.com>
To: emacs-orgmode@gnu.org
Subject: Re: insert picture feature request.
Date: Sun, 8 May 2011 09:28:09 -0700 (PDT)	[thread overview]
Message-ID: <115465.8886.qm@web32002.mail.mud.yahoo.com> (raw)
In-Reply-To: <BANLkTik2nUJ1y+Aa7c9QRCyvVuRTXBt6jA@mail.gmail.com>

Thanks Aankhen.

That seems to have fixed the technical problem. Unfortunately, because of the way irfan works, all I was able to get pictures of was the emacs screen! People with lots of screen real-estate can have emacs and their target application up at the same time, but that doesn't work on my older screen.

So instead, I have the code grab whatever is in the clipboard and use it. Then if I want a screen capture, I can use whatever tool is available. Surfulator has a really nice free screen capture. Also, with this approach I can right-click on images in the browser, click "copy image" and use those images directly. 

As for viewing, the only way I know is to export to HTML. Ctl-c e b is quick. I vaguely remember that there is a way to actually view images inline in Emacs, but its not portable or something.

Modified code below.

Thanks!
Mark

(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 filename
       (convert-standard-filename
        (concat
         (make-temp-name
          (concat (buffer-file-name)
                  "_"
                  (format-time-string
                   "%Y%m%d_%H%M%S_")) ) ".png")))
  (call-process "C:\\Program Files\\IrfanView\\i_view32.exe" nil nil nil
                "/clippaste" (concat "/convert=" filename) )
  (insert (concat "[[" filename "]]"))
  (org-display-inline-images))


--- On Sat, 5/7/11, Aankhen wrote:

> Subject: Re: [O] insert picture feature request.
> 
> I believe ‘convert-standard-filename’ should do it:
> 
> ,----
> | (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 filename
> |        (convert-standard-filename
> |         (concat
> |          (make-temp-name
> |           (concat
> (buffer-file-name)
> |               
>    "_"
> |               
>    (format-time-string
> |               
>     "%Y%m%d_%H%M%S_")) ) ".png")))
> |  (call-process "i_view32.exe" nil nil nil
> |               
> "/capture=2" (concat "/convert=" filename) )
> |  (insert (concat "[[" filename "]]"))
> |  (org-display-inline-images))
> `----
> 
> Seems to work here, although I’m unable to get the
> resulting image to
> display inline.
> 
> Aankhen
>

  reply	other threads:[~2011-05-08 16:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02 12:42 insert picture feature request Piter_
2011-05-02 13:28 ` Russell Adams
2011-05-02 14:23   ` brian powell
2011-05-02 23:34     ` Piter_
2011-05-04  0:37   ` Mark S.
2011-05-04 10:01     ` Rainer Stengele
2011-05-04 12:38       ` Jambunathan K
2011-05-04 14:10         ` Jambunathan K
2011-05-04 13:19       ` Russell Adams
2011-05-07 21:33         ` Mark S.
2011-05-08  4:29           ` Aankhen
2011-05-08 16:28             ` Mark S. [this message]
2011-05-08 18:51               ` Mark S.
2011-05-08 23:11                 ` Nick Dokos
2011-05-09  2:05                   ` Mark S.
2011-05-16  8:32                     ` Aankhen
2011-05-25  9:00           ` Stinky Wizzleteet
2011-05-04 13:28       ` Rainer Stengele

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=115465.8886.qm@web32002.mail.mud.yahoo.com \
    --to=throaway@yahoo.com \
    --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).