Hunterr Posted April 20, 2010 Posted April 20, 2010 hi, I was trying to sheach the forum for a way to screenshoot an image in a pre determinated spot and convert it to a "number" so I can compare it to an image I already have I'm new to programing and dont know that much, trying to learn a bit on my own, I found that code but cant make it work, the $HBITMAP is allways the same, what am I thinking wrong? and sorry for the noobish questions and bad english :S Func toString() MsgBox(0,"Imagem",$HBITMAP) EndFunc Func _PixelGetColor_CreateDC($hDll = "gdi32.dll") $iPixelGetColor_MemoryContext = DllCall($hDll, "int", "CreateCompatibleDC", "int", 0) If @error Then Return SetError(@error,0,0) Return $iPixelGetColor_MemoryContext[0] EndFunc Func _PixelGetColor_CaptureRegion($iPixelGetColor_MemoryContext, $iLeft = 707, $iTop = 236, $iRight = 858, $iBottom = 335, $fCursor = False, $hDll = "gdi32.dll") $HBITMAP = _ScreenCapture_Capture("", $iLeft, $iTop, $iRight, $iBottom, $fCursor) DllCall($hDll, "hwnd", "SelectObject", "int", $iPixelGetColor_MemoryContext, "hwnd", $HBITMAP) Return $HBITMAP EndFunc
ArmandoXS Posted April 21, 2010 Posted April 21, 2010 I had a simialar question earlier today, from what i now know you need to use the Pixel Search Command if you know the pixel color of the image you are looking for... That will give you a 0 or 1 if it found the pixel or not and hopefully you can use the array produced from the pixelsearch command as your assigned number
Brickoneer Posted April 21, 2010 Posted April 21, 2010 It looks like you are trying to search for an image/bitmap on the screen... there is already a thread on this same page with the identical problem, so I'll just quote my reply here as well.Search in the "Example Scripts" section of the forum. There have been several UDF libraries with this kind of functionality (searching for images/bitmaps on the screen)Some are faster than others, others have more features... (like transparency or color variation support)... it depends on what you're trying to do.Hope that helps!
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