Posts: 66
Threads: 19
Joined: May 2015
I bought a new laptop especially to make QM faster but the Scan command with RECT seems to be much slower in Windows 8.1 than Windows 7.
Is there a way I can speed up screen scans to find colours of pixels in Windows 8.1 please?
Posts: 12,072
Threads: 140
Joined: Dec 2002
Probably on Windows 7 scan was faster because Aero theme was disabled. Aero makes scan several times slower. On Windows 8 impossible to disable.
Next QM version will have an option to make scan fast even when Aero is enabled. I will upload it soon, maybe this week, and announce in subforum "QM and Forum Info".
Posts: 66
Threads: 19
Joined: May 2015
A quick fix soon would be great as SCAN is much slower with Windows 8.1.
Thank you very much I am grateful.
Posts: 12,072
Threads: 140
Joined: Dec 2002
QM 2.4.3 is not finished, but it is stable in its current state, and you can use it.
Download:
http://www.quickmacros.com/dev/quickmac.exe
To make existing scan code faster, add flag 0x1000. Example: scan "image:hFD7DCAF6" w 0 1|2|16|0x1000
To make new scan code faster, in "Find Image" dialog click checkbox "The window can be in background" 2 times (make indeterminate state). Or click 1 time, if "can be in background" is more important.
Posts: 66
Threads: 19
Joined: May 2015
This is brilliant thank you much quicker but I get an error "invalid argument" when I try and scan for the colour black using QM version 2.4.3.0 but it worked okay on 2.4.2.2
RECT r
r.left=1; r.top=1; r.right=100; r.bottom=100
scan("color:0x000000" win r 0x1000)
Posts: 12,072
Threads: 140
Joined: Dec 2002
Now fixed. Download/install again. Thank you.
Posts: 66
Threads: 19
Joined: May 2015
It works - thank you genius and hero!
Hopefully the new version of QM will also have a faster PIXEL function as that is much slower on QM with Windows 8.1 than Windows 7.
Sorry to ask for so much
Posts: 12,072
Threads: 140
Joined: Dec 2002
Posts: 66
Threads: 19
Joined: May 2015
Posts: 12,072
Threads: 140
Joined: Dec 2002
2015-06-04. Fixed: often does not work with flag 1.
Function
FastPixel
;/
function x y hwnd [flags] ;;flags: 1 client area
;Gets pixel color from window.
;Almost same as pixel(x y hwnd flags), but faster when Aero theme is enabled.
;When Aero is enabled, works in background windows.
;Does not activate the window.
;If hwnd is 0, gets from screen, slow.
__Hdc dc
if(!hwnd) dc=GetDC(0); ret GetPixel(dc x y)
if(!IsWindow(hwnd)) end ERR_WINDOW
dc=iif((flags&1) GetDC(hwnd) GetWindowDC(hwnd))
__MemBmp m.Create(1 1 dc x y) ;;GetPixel fails if not in clipping region
ret GetPixel(m.dc 0 0)
test
Macro
Macro2545
int w=win("Registry Editor" "RegEdit_RegEdit")
int c=id(2 w) ;;list
act w
0.5
PerfFirst
;_i=pixel(100 100 c 1)
_i=FastPixel(100 100 c 1)
PerfNext;PerfOut
out F"0x{_i}"
Posts: 66
Threads: 19
Joined: May 2015
Very fast and I am very grateful this is excellent you helped me a lot. Good work