when to initial a call of Gdip_Startup()
Posted: 21 Dec 2019, 17:22
when using gdip ahk lib, Gdip_Startup() must to initial first before access to all gdip's function
My script has different function to use gdip's function.
Should i call Gdip_Startup() when ahk script loaded, or
calling this function inside of each of custom fucntion where to use gdip's function ?
Some of custom function will be called by a timer as an interval.
For example, a timer of every one second to check bitmap changing on screen
For the preceding way, if there any overhead of calling and destroying the gdip token repeatedly
My script has different function to use gdip's function.
Should i call Gdip_Startup() when ahk script loaded, or
calling this function inside of each of custom fucntion where to use gdip's function ?
Some of custom function will be called by a timer as an interval.
For example, a timer of every one second to check bitmap changing on screen
For the preceding way, if there any overhead of calling and destroying the gdip token repeatedly
Code: Select all
gdipToken := Gdip_Startup()
SetTimer, functionC , 1000
OnExit, ExitSub
functionA ()
{
; some gdip stuff
}
functionB ()
{
; some gdip stuff
}
functionC ()
{
; some gdip stuff
}
ExitSub:
Gdip_Shutdown(gdipToken)
return
Code: Select all
SetTimer, functionC , 1000
functionA ()
{ gdipToken := Gdip_Startup()
; some gdip stuff
Gdip_Shutdown(gdipToken)
}
functionB ()
{
gdipToken := Gdip_Startup()
; some gdip stuff
Gdip_Shutdown(gdipToken)
}
functionC ()
{
gdipToken := Gdip_Startup()
; some gdip stuff
Gdip_Shutdown(gdipToken)
}
return