m0nk3yI3unz Posted May 17, 2008 Share Posted May 17, 2008 Hey all. Ive been trying to find a way to get pixel information, more specifically it's color, at a coordinate of a screenshot stored in memory. Im using the _ScreenCapture_... functions, and I simply cant find a way to do it. I know there are other alternatives, such as creating a GUI that is the same size as the desktop and pasting it on there, but it still doesn't work for me. Too bulky, and ugly. Any help would be greatly appreciated. Thanks! -Monkey Monkeh. Link to comment Share on other sites More sharing options...
rasim Posted May 17, 2008 Share Posted May 17, 2008 (edited) Hi! Don`t sure, that this work correctly, but try:#include <GDIPlus.au3> #include <ScreenCapture.au3> _GDIPlus_Startup() $hBMP = _ScreenCapture_Capture("") $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) If $hBitmap = 0 Then MsgBox(16, "Bitmap Create", "Error") Exit EndIf $hDC = _WinAPI_GetDC("") $aRet = DllCall("gdi32.dll", "int", "GetPixel", "hwnd", $hDC, "int", 100, "int", 100) ConsoleWrite("0x" & Hex($aRet[0], 6) & @LF) _WinAPI_ReleaseDC(0, $hDC) _GDIPlus_ImageDispose($hBitmap) _WinAPI_DeleteObject($hBMP) _GDIPlus_Shutdown()Note: The return value is the RGB value of the pixel Edited May 17, 2008 by rasim Link to comment Share on other sites More sharing options...
m0nk3yI3unz Posted May 18, 2008 Author Share Posted May 18, 2008 Thanks a bunch - it worked, but not for what I need, and its not you, its this program. It prevents you from getting pixel colors from the screen while its running - its basically a game protector app. perhaps there is a way to get it from a saved file? I could then just use the screencapture save to file command. Thanks! Monkeh. Link to comment Share on other sites More sharing options...
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