Org-mode截图与显示图片(Windows 7)

非IT人士+1

很奇怪这段代码在我的spacemacs上运行不了,调试显示是shell-command这一行出问题编译是总把i_view.exe变成i_view.exe,应该是此处的正则表达式出了问题,不知道是不是网页格式引起的,调试了两天都没解决,请问能发一个txt纯文本附件么?

Win7截图软件的话,可以试试一个叫Snipaste的软件,我觉得挺好的。

现在 org-download 已经支持 IrfanView 截图了(我提的 PR),不需要用上述代码。

snipaste 好像只有付费版才支持命令行,命令行截图目前 Windows 上我用的最好的也还是 IrfanView

在spacemacs中怎么配置呢? 这样配置好像不行。

     (org :variables
          org-download-screenshot-method "IrfanView")

抄楼上的,可以用:

(defun screen-capture ()
  "Take a screenshot into a unique-named file in the current buffer file
   directory and insert a link to this file."
  (interactive)
  (lower-frame)
  (let ((capture-name (concat
                       (format-time-string "%Y%m%d%H%M%S") ".png"))
        (capture-save-path (concat
                            (file-name-directory buffer-file-name) "images/")))
    (setq capture-file (concat capture-save-path capture-name))
    (shell-command (concat
                    "i_view64 /capture=4 /dpi=(150,150) /convert="
                    (replace-regexp-in-string "/" "\\\\" capture-file)))
    (insert (concat
             "[[file:./images/" capture-name "][Capture-" capture-name "]]")))
  )

(define-key org-mode-map (kbd "C-c o s") 'screen-capture)

先安装IrfanView,把i_view64命令 加到环境变量中,然后spacemacs配置如下

 (org :variables
      org-download-screenshot-method "i_view64 /clippaste /convert=\"%s\"")

效果如下 gif

我一般不喜欢直接在buffer中显示图片,我使用 posframe 弹出图片3秒后,确定效果

IrfanView支持截图期间变换窗口嘛?比如上图中不想截屏Emacs,但是需要截屏Chrome。WIN下哪些命令行截屏工具支持在截图期间变换窗口?

QQ、微信、系统自带截图工具任意地方截屏都可以。