2 Star 9 Fork 4

学边成 / paste_image

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dump-clipboard-png.ps1 557 Bytes
一键复制 编辑 原始数据 按行查看 历史
学边成 提交于 2019-04-08 10:53 . v001
Add-Type -Assembly PresentationCore
$img = [Windows.Clipboard]::GetImage()
if ($img -eq $null) {
Write-Host "剪贴板中没有图片"
Exit
}
Write-Host ("保存{0}x{1}大小的图片" -f $img.PixelWidth,$img.PixelHeight)
$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0)
$stream = [IO.File]::Open(("$args"), "OpenOrCreate")
$encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder
$encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb))
$encoder.Save($stream)
$stream.Dispose()
AutoHotkey
1
https://gitee.com/nimeiz/paste_image.git
git@gitee.com:nimeiz/paste_image.git
nimeiz
paste_image
paste_image
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891