Aceguy Posted May 23, 2009 Posted May 23, 2009 Hi does anyone know if the pixelsearch() func is as slow in winodws 7 as it is in vista, i have diabled Aero theme, (which speed it up dramatically). gonna try the beta windows 7 and would like to know if its as lightning fast with the Glass theme on. Many Thanks. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
monoceres Posted May 23, 2009 Posted May 23, 2009 My guess is that it's as slow as Vista. The reason is that just like Vista, win7 emulates gdi so when you call GetDC() it needs to copy stuff and whatever. More here. Broken link? PM me and I'll send you the file!
sandin Posted May 23, 2009 Posted May 23, 2009 try this: expandcollapse popup#Include <WinAPI.au3> #include <Color.au3> Global $x1 = 50, $y1 = 50, $x2 = 100, $y2 = 300, $color = 0xFFFFFF, $speed = 1, $win_handle = "[ACTIVE]" Global $time_start = TimerInit() $pixel_coord = _pixel_search_win7($x1, $y1, $x2, $y2, $color, $speed, $win_handle);X-start, Y-start, X-end, Y-end, Color, Speed, WinHandle if NOT @error Then $time = TimerDiff($time_start) MsgBox(0, "Win7", $pixel_coord[0] & ", " & $pixel_coord[1] & @CRLF & "time [ms]: " & Round($time, 2)) Else MsgBox(0, "", "color not found") EndIf $time_start = TimerInit() $pixel2 = PixelSearch($x1, $y1, $x2, $y2, $color, $speed, -1, $win_handle) if NOT @error Then $time = TimerDiff($time_start) MsgBox(0, "PixelSearch", $pixel2[0] & ", " & $pixel2[1] & @CRLF & "time [ms]: " & Round($time, 2)) Else MsgBox(0, "", "color not found") EndIf Func _pixel_search_win7($i_Left, $i_Top, $i_Right, $i_Bottom, $i_Color, $i_Speed = 1, $i_Win_handle = 0) if $i_Speed = -1 then $i_Speed = 1 if $i_Win_handle = -1 then $i_Win_handle = 0 Local $hGDI = DllOpen("gdi32.dll"), $color, $found = false Dim $ret_val[2] Local $hDC = _WinAPI_GetDC($i_Win_handle) For $i = $i_Top To $i_Bottom Step +$i_Speed For $j = $i_Left To $i_Right Step +$i_Speed $color = DllCall($hGDI, "int", "GetPixel", "int", $hDC, "int", $j, "int", $i) if "0x" & Hex($color[0], 6) = $i_Color Then $found = True $ret_val[1] = $i $ret_val[0] = $j ExitLoop EndIf Next if $found = True then ExitLoop Next _WinAPI_ReleaseDC($i_Win_handle, $hDC) DllClose($hGDI) if $found = true Then Return $ret_val Else SetError (1) EndIf EndFunc anyway, always use winhandle it'll speed up the search Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll
Richard Robertson Posted May 24, 2009 Posted May 24, 2009 Yes, like Vista, Windows 7 takes advantage of hardware rendering. This means GDI commands (software rendering) will suffer.
Aceguy Posted May 24, 2009 Author Posted May 24, 2009 thanks for that test script, after a momoth 26hrs reinstallation to win7 the testscript results are as follows. Win7 1380.47 MS Pixelsearch 17.18 so the only way is to turn it off [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now