Original Post
GetRegionData(hrgn, reg_size, rgndata) merely returns the "last" updated list of regions. Is there any way to get ALL regions inside a given inactive window that are currently visible?
( for example, if there is a game running inside a window and the window is inactive, and other windows are on top of it, but some parts are still visible, I want to keep updating only those visible parts )
I don''t really want to do that, I used this example to explain what regions I need, in more detail.
--- --- ---
When I use the GetRegionData function, I get regions of a window that need to be updated, however the problem I''m encountering right now is that when I drag another window across my program''s window, since the mouse cursor doesn''t move uniformly (it doesn''t always move by ONE pixel, because of the speed it''s set to), I get missing regions. For example here''s the actual dump of values I get from GetRegionData:
(I dragged another window across my window from left to right, very slowly, and another window was blocking much space, thats why the values are so small, but it''s easier to get the idea when numbers are smaller)
These are the RECTs I get; order: [left, top, right, bottom]:
region: [0, 0, 1, 2]
region: [2, 0, 3, 2]
region: [3, 0, 4, 2]
region: [5, 0, 6, 2]
region: [6, 0, 7, 2]
region: [7, 0, 8, 2]
region: [8, 0, 9, 2]
region: [9, 0, 10, 2]
region: [10, 0, 11, 2]
region: [11, 0, 12, 2]
region: [12, 0, 13, 2]
region: [13, 0, 14, 2]
region: [15, 0, 16, 2]
region: [18, 0, 19, 2]
region: [19, 0, 20, 2]
---
OK, take the first value from the list:
left: 0
top: 0
right: 1
bottom: 2
This basically means the region is 1 pixel wide and 2 pixels tall, and it starts at x=0 y=0. This is reasonable.
Take the 2nd value in the list:
[2, 0, 3, 2]
This tells us the same, 1 pixel wide and 2 pixels tall. However, it doesn''t start at X = 1 (where the previous region ended). This creates a
1-pixel-wide gap in the resulting image.
It seems to me that the region should have been: [1, 0, 3, 2]. Where did it go?
Then the order resumes to normal for the next few pixels. ( as long as the mouse arrow doesn''t jump 2 pixels per frame, and regions are 1-pixel in width, the regions seem to be right )
---
What would be the optimal solution to find the Right regions? (Can anyone point out some tutorials on this topic, or some pseudo-code perhaps)
Greg Damon
www.falloutsoftware.com