Created
November 30, 2020 18:54
-
-
Save dataserver/32a4b79d14b261e9e93cf5f066c2883a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#SingleInstance, Force | |
#include, lib\gdip_all.ahk | |
; https://github.com/tariqporter/Gdip | |
; https://github.com/tariqporter/Gdip/blob/master/Gdip.ahk | |
IfNotExist, Screenshots | |
FileCreateDir, Screenshots | |
PrintScreen:: | |
FormatTime, TimeString, , yyyy-MM-dd HHmmss | |
file = %A_WorkingDir%\Screenshots\%TimeString%.png | |
Screenshot(file) | |
return | |
Screenshot(outfile) | |
{ | |
pToken := Gdip_Startup() | |
screen = 0|0|%A_ScreenWidth%|%A_ScreenHeight% | |
pBitmap := Gdip_BitmapFromScreen(screen) | |
Gdip_SaveBitmapToFile(pBitmap, outfile, 100) | |
Gdip_DisposeImage(pBitmap) | |
Gdip_Shutdown(pToken) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment