Open archiif opened 2 years ago
Why not just use powershell (Original idea from https://www.sastibe.de/2018/11/take-screenshots-straight-into-org-files-in-emacs-on-win10/)
((windows-nt cygwin)
(if (executable-find "powershell")
"powershell -command \"Add-Type -AssemblyName System.Windows.Forms;[System.Windows.Forms.Clipboard]::GetImage().Save('%s', [System.Drawing.Imaging.ImageFormat]::Png);\""
(user-error
"Failed to save image using powershell")))
; "powershell -command \"Add-Type -AssemblyName System.Windows.Forms;if ($([System.Windows.Forms.Clipboard]::ContainsImage())) {$image = [System.Windows.Forms.Clipboard]::GetImage();[System.Drawing.Bitmap]$image.Save('%s',[System.Drawing.Imaging.ImageFormat]::Png); Write-Output 'clipboard content saved as file'} else {Write-Output 'clipboard does not contain image data'}\""
On default installations of ImageMagick on Windows, executables such as
convert.exe
are considered a legacy feature (perhaps due to name collisions with system programs) and as such are not included unless the user asks for it during the installation. Instead, these utilities are treated as subcommands that can be accessed throughmagick.exe
.