AHK_H not compatible with Gdip_BitmapFromScreen?

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
gameba
Posts: 18
Joined: 20 Mar 2018, 12:24

AHK_H not compatible with Gdip_BitmapFromScreen?

11 Apr 2018, 21:24

Code: Select all

threads:=[]
Loop 8
threads[A_Index]:=AhkThread("
(
Process, Priority,, High
SetBatchLines, -1
#Include <Gdip_All>
#Include <Gdip_ImageSearch>
pToken := Gdip_Startup()
run:
	Loop 10000
	{
		linkSmall:=""G:\img\test3.png""
		pSmall := Gdip_CreateBitmapFromFile(linkSmall)

		;linkBig:=""G:\img\test2.png""
		;pBig := Gdip_CreateBitmapFromFile(linkBig)
		pBig := Gdip_BitmapFromScreen(""0|0|200|200"")

		RET := Gdip_ImageSearch(pBig,pSmall,LIST,0,0,0,0,4,0,1,0)
		Gdip_DisposeImage(pSmall)
		Gdip_DisposeImage(pBig)
	}
	END:=A_TickCount
return
OnExit:
Gdip_Shutdown(pToken)
ExitApp

)", A_Index)

ESC::
ExitApp
Its not use maximum cpu power (only work 5%)
Image

I tried change Gdip_BitmapFromScreen to Gdip_CreateBitmapFromFile, Its work perfect
Image

Pls help me, Any way to Gdip_BitmapFromScreen compatible AHK_H?
ps: I using AHK 1.1.28 + AHK_H v1

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 20 guests