Jump to content

Screen scraping


Nine
 Share

Recommended Posts

6 hours ago, Nine said:

Let me know if you have used it...

Yes, I have used it :lol:. However, my concentration is almost zero at this time of day. So I can only tell you that it works for me. The screenshot is a bit blurry in some areas.

Spoiler

Test-Area.jpg.01945236fc890bfa9b855886e666d0a6.jpg

(EDIT : Excerpt of the screenshot packed into a spoiler.)

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

Link to comment
Share on other sites

Link to comment
Share on other sites

Listen. You do not understand.  It is working perfectly fine.   You need to setup info tool for window not screen.  You need to make window scale 100%.  It is working for background and foreground.  Stop repeating it is not working and show the code and results and the setup of info tool, etc.

Link to comment
Share on other sites

I find myself a bit annoyed. Because I re-read it with google translate, so I don't understand it very well. I have adjusted the coordinate information to windows, so I got the correct color. Since all the code I used before was taking the coordinates with the client, now that I switch to windows, I have to start all over again. Is there a way to make the UDF use coordinates from the client?

Link to comment
Share on other sites

you could substract the client x,y from the screen x,y ( at 0,0 usually ) and get those ? Or add the client X,Y to the screen ?
There is code in the help file that has the x,y example  ( GUICtrlCreateContextMenu > Func ClientToScreen($hWnd, ByRef $x, ByRef $y) )

Edited by argumentum
added link

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

3 hours ago, Loc said:

so I got the correct color

Glad you made it work.

3 hours ago, Loc said:

Is there a way to make the UDF use coordinates from the client?

Yes, but I will not, it would make my UDF slower.  This is out of question. ;)

However, here the way you can calculate the delta of Window and Client Area :

#include <StructureConstants.au3>
#include <Constants.au3>
#include <WinAPIConv.au3>
#include "..\GetScreen\GetScreen.au3"

Local $hWnd = WinGetHandle("[CLASS:SciTEWindow]")

; this calculates the screen position of the window
Local $aWin = WinGetPos($hWnd)
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "", "Window not found")
Local $Width = $aWin[2], $Height = $aWin[3]

; this calculates the screen position of the client area of the window
Local $tPoint = DllStructCreate($tagPOINT)
$tPoint.X = 0
$tPoint.Y = 0
_WinAPI_ClientToScreen($hWnd, $tPoint)
Local $xDiff = $tPoint.X - $aWin[0], $yDiff = $tPoint.Y - $aWin[1]

MsgBox($MB_SYSTEMMODAL, "", "Diff from Window to Client = " & $xDiff & "/" & $yDiff)

_GetScreen_Initialize($Width, $Height)
_GetScreen_GetWindow($hWnd)

Local $color = _GetScreen_GetPixel(52+$xDiff, 122+$yDiff) ; 52 and 122 are client coordinates
MsgBox($MB_SYSTEMMODAL, "", Hex($color, 6))

You just need to calculate it once (at the beginning of the script) and reuse the deltas for each call to get pixel...

Edited by Nine
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...