经常会遇到需要截取固定区域图像的情况,例如云顶之奕英雄名字那块的识别,所以写了下面的demo Include Gdip.ahk ^1:: ^2:: ^3:: ^4:: ^5:: ;MsgBox,% A_ThisHotkey 970 1070
经常会遇到需要截取固定区域图像的情况,例如云顶之奕英雄名字那块的识别,所以写了下面的demo
#Include Gdip.ahk
^1::
^2::
^3::
^4::
^5::
;MsgBox,% A_ThisHotkey 970 1070
;判断按键 800|1040|170|30
switch A_ThisHotkey
{
case "^1":
screen=800|1040|120|30
case "^2":
screen=1000|1040|120|30
case "^3":
screen=1200|1040|120|30
case "^4":
screen=1400|1040|120|30
case "^5":
screen=1600|1040|120|30
}
InputBox,heroName,input heroName
picturePath:=A_ScriptDir "\config\picture\"
Screenshot(picturePath heroName ".png",screen)
return
Screenshot(OutFile,screen)
{
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)
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。


#Include Gdip.ahk 你这用了另一个脚本 那么这个脚本呢?