Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get pixel color seems somewhat slow in Win8...
#1
Code:
Copy      Help
function# SX SY EX EY color [VAR] [POINT&p]

Searches a region of the screen for a pixel of the specified color.
Returns: 1 found, 0 not.

SX, SY - top-left coord of the search region relative to the active window.
EX, EY - bottom-right coord. The point is inside the search region.
color - search for this pixel color, in 0xBBGGRR format.
VAR - allowed color component difference, 0-255.
p - optional POINT variable that receives found pixel coordinates in screen.

EXAMPLE
POINT p
if PixelSearch(552 21 592 51 0x2f59fd 0 p)
    mou p.x p.y

opt noerrorshere 1
RECT r; SetRect &r SX SY EX+1 EY+1
if(!scan(F"color:{color}" win("A" "B") r 16 VAR)) ret
if(&p) p.x=r.left; p.y=r.top
ret 1



Hi, Gintaras~!

Your advices and codes are very useful in making game macro... ^^;

bytheway, I find it somewhat slow finding pixels (not exactly find, it's your script "Pixel Search" script before)
even though I turned off aero and transparency with classic windows theme.

in Win7, Its almost perfect.

Is there any way to speed up search pixels in win8?

your code was(I modified) upper there.

Always THANK YOU~!
#2
Macro Macro2541
Code:
Copy      Help
PerfFirst
rep 100
,PixelSearch(0 0 600 400 RandomInt(0 0xffffff))
PerfNext;PerfOut


;Single loop execution time:
;;;Windows 10: 18 ms
;;;Windows 7: 20 ms
;;;Windows 7 without Aero theme: 1.6 ms
;;;Windows 8.1: 20 ms
;;;Windows XP: 1.4 ms

;Without an Aero theme >10 times faster. But I don't know how to disable it on Windows 8.1 and 10. It seems impossible.
;Cannot make it faster. The speed depends on Windows, ie how slowly it gives screen pixels. Then the searching part is much faster.
#3
Ok I'm formatting harddisk... THANK YOU AGAIN ~


Forum Jump:


Users browsing this thread: 1 Guest(s)