Code: Select all
#Include C:\Users\admin\Desktop\p\Gdip_All.ahk
; https://github.com/marius-sucan/AHK-GDIp-Library-Compilation/blob/master/ahk-v1-imageDir := A_ScriptDir
F3:: ; F3 = Save screenshot to file
SaveDir = C:\Users\admin\Desktop\abc
pToken := Gdip_Startup(), pBitmap := Gdip_BitmapFromScreen("10|20|307|204") ; x|y|w|h
FormatTime ts,, yyMMdd-HHmmss
Gdip_SaveBitmapToFile(pBitmap, dir "\image" ts ".png"), Gdip_DisposeImage(pBitmap), Gdip_Shutdown(pToken)
Return
Code: Select all
#Include C:\Users\admin\Desktop\p\Gdip_All.ahk
; https://github.com/marius-sucan/AHK-GDIp-Library-Compilation/blob/master/ahk-v1-imageDir := A_ScriptDir
F3:: ; F3 = Save screenshot to file
loop
{
index := 0, pToken := Gdip_Startup(), pBitmap := Gdip_BitmapFromScreen("927|0|700|620") ; x|y|w|h
SaveDir = C:\Users\admin\Desktop\abc
Loop
FormatTime ts,, yyMMdd-HHmmss
Until !FileExist(image)
Gdip_SaveBitmapToFile(pBitmap, dir "\image" ts ".png"), Gdip_DisposeImage(pBitmap), Gdip_Shutdown(pToken)
sleep 5000
}
Code: Select all
#Requires AutoHotkey v1.1.33
#Include d:\Q\vis2\lib\Gdip_All.ahk
imageDir := A_ScriptDir
F3:: ; F3 = Save screenshot to file
pToken := Gdip_Startup()
Loop 3 {
SoundBeep 2500
pBitmap := Gdip_BitmapFromScreen("927|0|700|620")
FormatTime ts,, yyMMdd-HHmmss
Gdip_SaveBitmapToFile(pBitmap, imageDir "\image" ts ".png")
Sleep 1000
}
Gdip_DisposeImage(pBitmap)
Gdip_Shutdown(pToken)
MsgBox 64, Status, Done!, 1
Run % imageDir
Return
I just found out 3 of this work and imgs were saved in C:\, not in folder have .ahk