Jump to content
Sign in to follow this  
DrunkenDonkey

PixelSearch/PixelGetColor not working

Recommended Posts

DrunkenDonkey

Hey guys, I just found that under Windows 7 beta 1 x64 both functions don't work in a game, but work fine on the desktop. Any ideas? They both work on the same game in XP 32

Share this post


Link to post
Share on other sites
DrunkenDonkey

Here is a simple snipped:

func color($x,$y)

$clr=PixelGetColor($x, $y)

If Not @error Then

consolewrite("Pixel color at (" & $x & "," & $y & ") is " & Hex($clr,6) & @CRLF)

EndIf

EndFunc

On XP32 it works both on desktop and the game, on windows 7 the desktop is okay, game does not rise an error, but the output is simply "Pixel color at (100,100) is 000000" and stays the same no matter if I change coords. Sometimes gets stuck into some other value, light gray, but neve anything sane

Share this post


Link to post
Share on other sites
Drew

I had a very simliar issue not too long ago. If your game is ran in a window, rather than fullscreen, this will cause problems if you are trying to use the Opt for client-coords; because Pixel Search searchs the screens coordinates.

However there is a relatively easy way I managed to get around this, and only search the "wanted" coordinates throughout the client side only.

Lmk if this is the case and I'll elaborate.

Share this post


Link to post
Share on other sites
DrunkenDonkey

No, game is fullscreen sadly, I have tried:

Opt("CaretCoordMode", 2) ;1=absolute, 0=relative, 2=client

Opt("PixelCoordMode", 2) ;1=absolute, 0=relative, 2=client

to every possible option and still got 0000000 as color. I have downloaded AutoHotkey and tested his similar function which have 3 possible ways to operate, all 3 returned 0 too. It looks windows 7's directx is doing something bad. I have heard that it supports 10-bit colors, maybe that's the reason? I guess only some of the developers can answer :)

Share this post


Link to post
Share on other sites
dgarrett8

I had the same problem with directx in quake3. I fixed the problem basically by fixing the screen size of the game. Although it's minimized, you really can't tell the difference. Try using your program while it's minimized.


"I think, therefore I am"[size="1"]René Descartes[/size]

Share this post


Link to post
Share on other sites
DrunkenDonkey

Thanks man, that was it, went to window mode and everything is working :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.