Hi Alex,
again, I can not test revBrowserSnapshot since it does not work for me. The workaround I showed you with the export snapshot command uses the screen coordinates = absolute coordinates and will dutifully take a snapshot of the region of interest.
So if you know exactly where your area of interest is you could get the local coordinates and converte them to global coordinates and use that in the scripts I posted.
If you want to go the way of the scrolling you definitely can do that. It is a little tricky but it works.
suppose you have initialised your browser instance and store the id in a global variable gBrowserId then you can put this into a vertical scrollbar right next to the browser
Code: Select all
global gBrowserId
on scrollbarDrag theValue
revBrowserSet gBrowserId, "vScroll", theValue
end scrollbarDrag
on mouseDown
lock screen
put revBrowserGet (gBrowserId, "vScroll") into tOldVScroll
revBrowserSet gBrowserId, "vScroll", "100000"
put revBrowserGet (gBrowserId, "vScroll") into tVScroll
revBrowserSet gBrowserId, "vScroll", tOldVScroll
set the startValue of me to 0
set the endValue of me to tVScroll
end mouseDown
this goes into a horizontal scrollbar
Code: Select all
global gBrowserId
on scrollbarDrag theValue
revBrowserSet gBrowserId, "hScroll", theValue
end scrollbarDrag
on mouseDown
lock screen
put revBrowserGet (gBrowserId, "hScroll") into tOldHScroll
revBrowserSet gBrowserId, "hScroll", "100000"
put revBrowserGet (gBrowserId, "hScroll") into sHScroll
revBrowserSet gBrowserId, "hScroll", tOldHScroll
set the startValue of me to 0
set the endValue of me to sHScroll
end mouseDown
Now you have srollbars that
a let you see what the scroll (vertical and horizontal) is and you can then set the scroll with revBrowserSet. This works regardless of whether the scrollbars of the browser object are visible or not. Just max scroll increases by 15 v and 15 h if they are visible.
That way you could manually find out at what scroll the area of interest is and set it by script and then do a revBrowserSnapshot from a small browser window.
However I noticed that the snap shot is always starts from the left top corner of the browser screen no matter the scrolled positions of the vertical bar and horizontal bar
I tried this. If I dont create a new browser instance then this does not happen. In your code do you make shure you only initialize the browser once?
If you could give me an example site of what you are trying to do I could cook up a little stack to show what I mean. (like on
http://www.xyz.com I always want to have a thumbnail of the weather or somesuch)
regards
Bernd