From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Screenshots, frame shots straight from Emacs Date: Fri, 23 Jul 2021 08:52:35 +0800 Message-ID: References: <87sg1dgbbk.fsf@omarpolo.com> <87pmwhg843.fsf@omarpolo.com> <8735t96mxj.fsf@omarpolo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33080"; mail-complaints-to="usenet@ciao.gmane.io" To: Hongyi Zhao , Omar Polo , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 23 02:53:15 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6jRC-0008Ol-FN for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 23 Jul 2021 02:53:14 +0200 Original-Received: from localhost ([::1]:34146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6jRB-0005Nj-9V for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Jul 2021 20:53:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6jQp-0005Kv-7C for help-gnu-emacs@gnu.org; Thu, 22 Jul 2021 20:52:51 -0400 Original-Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]:42589) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6jQn-0004v6-L6 for help-gnu-emacs@gnu.org; Thu, 22 Jul 2021 20:52:50 -0400 Original-Received: by mail-lj1-x234.google.com with SMTP id b16so8363718ljq.9 for ; Thu, 22 Jul 2021 17:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=pPdJ1hJwpK/4wPWG+S7VRVOKqI/tv939XuVWrdiKfz0=; b=o4X39hMXE+rTw3aCRLMIEyqe6+c2bXlC8n3NuuANYYDECk0Gf5opKps7BSUupo3lsm Y6UD6z0An2pqnhw66OkxBTBKkMDBPbbVxVOSr49VN18ge2At8JdSOvaDemvArTmx/fhv vRhNGANxzzFk/toN4TNmqXOIQNyJDDyHjqD90m7pxvwgLih8Ag2V5fztBqUrZAE0uy23 WKiZzdCRa3dMw3DonwmjBlsJ2qnyinw09xR9CrHMPLbdxcNiapI8WyTMhafTnafRthIU J/n+JKqDn19QnGt/lmgyqwyAl9EqMPBE2WIiWZVmdk1DhpDH/eMAhJvYIUPcaf7b9m1B XvLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=pPdJ1hJwpK/4wPWG+S7VRVOKqI/tv939XuVWrdiKfz0=; b=LcSh11+Mo/SNkxDvsRQneYQusak32ju87rX8p/MSyzFeLkkm5AS5D0CjILrkhAoali Hg1BtBGNh1J7C3tIemNdNz+ieM/Zb2KI7NYOcMTyYyhbbzOLtVO3A/Ag5KvoVGwy5X/Q J6Kw6ZqCZUTNmIxqIeC1n5ul1VOLQ/NrOYA9kz2vPRfvaAPiGuTl5Z61zSxIgGBpfaf2 T68ebEMKMrgRzS5qxanCEFW/iY4Eb2NKauOGDGaCQbcV0WpJDW7FEPv6ORWGG6+f1Zs/ hrwGuLtEqvcjYBm1RoTLUPajt3Jp9vfSKTCKcJQ5SXYXK0o4WQeU+Bv1JFfsOD92OE6M blhQ== X-Gm-Message-State: AOAM530ZqbXUUfV5zSEvNxFMDYsZ7pnPlPuJyTj+OMTob0yxPL2f1ElX fyvmlMWTMACqlgmr8Ozt3ARO0hdrVqUnNOjSdZI= X-Google-Smtp-Source: ABdhPJwHRCO6ttytQv49Rxf2/gu0+jO45oD0ir8jT8rmxDkh5cRbFtmaV5exUUc2QFANEUhwdE70YuZ+sei9r0JEn5U= X-Received: by 2002:a2e:8858:: with SMTP id z24mr1736803ljj.413.1627001566711; Thu, 22 Jul 2021 17:52:46 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=hongyi.zhao@gmail.com; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132056 Archived-At: On Wed, Jun 23, 2021 at 5:33 PM Jean Louis wrote: > > As you like screenshots, here is one way to generate Emacs frame shots > straight from Emacs without using external programs: > > (defvar frameshot-directory "~/Media/Pictures/Screenshots/" > "Default directory for frame shots") > > (defvar frameshot-format 'png > "Default frame shot format, could be 'jpg or 'svg, inspect the > function `x-export-frames'") > > (defun frameshot () > "Save Emacs frame as frame shot. > > Directory is determined by variable `frameshot-directory' and if > not defined, it will be saved in the `$HOME' directory." > (interactive) > (let* ((image (x-export-frames nil (or frameshot-format 'png))) > (base-directory (or frameshot-directory (getenv "HOME"))) > (directory (concat (file-name-as-directory base-directory) (format-time-string "%Y/%m/%Y-%m-%d/"))) > (file (concat directory (format-time-string "Screenshot-%Y-%m-%d-%T.") (symbol-name frameshot-format)))) > (make-directory directory t) > (with-temp-file file > (insert image)) > (find-file directory) > (message "Frame shot saved as `%s'" file))) Thank you very much for your courtesy. I like screenshot is due to its intuitive and simplicity compared to wording in many scenarios. Below is some additional requirements I want to have with a decent screenshot method: 1. Have the delay feature, so that I can do some operations before the screenshot is captured, say, click on mouse button, open a dropdown menu, and so on. 2. Have the post-processing feature, which can be used for some touch ups on the generated screenshot subsequently. I am not sure whether the recommended method here has these characteristics. Best, -- Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province