Dear all, I test this code :
void test (HDC hdc, HRGN hregion) { RECT srcbox; RECT dstbox;
GetClipBox(hdc, &dstbox); GetRgnBox(hregion, &srcbox);
TRACE("Before ExtSelectClipRgn:%s,%s\n", wine_dbgstr_rect(&srcbox), wine_dbgstr_rect(&dstbox) );
ExtSelectClipRgn(hdc, hregion, RGN_AND );
GetClipBox(graphics->hdc,&dstbox);
TRACE("After ExtSelectClipRgn:%s,%s\n", wine_dbgstr_rect(&dstbox) ); }
It output in wine is : Before ExtSelectClipRgn:(693,5)-(763,28),(693,5)-(763,28) After ExtSelectClipRgn:(693,5)-(693,5)
But I think it should be output: Before ExtSelectClipRgn:(693,5)-(763,28),(693,5)-(763,28) After ExtSelectClipRgn:(693,5)-(763,28)
Where is my understanding mistake, or is it a bug in ExtSelectClipRgn?
Thank you!
This is possible if both regions are more complex shapes (not just one rectangle) that do not share any pixels. For example, the clip region could consist of the rectangles (693,5)-(694,6) and (762,27)-(763,28); and hregion could be (762,5)-(763,6) and (693,27)-(694,28).
You can use GetRegionData to determine the exact set of rectangles in the region.
On 2014-12-03 03:36, Changhui Liu wrote:
Dear all, I test this code :
void test (HDC hdc, HRGN hregion) { RECT srcbox; RECT dstbox;
GetClipBox(hdc, &dstbox); GetRgnBox(hregion, &srcbox); TRACE("Before ExtSelectClipRgn:%s,%s\n", wine_dbgstr_rect(&srcbox), wine_dbgstr_rect(&dstbox) ); ExtSelectClipRgn(hdc, hregion, RGN_AND ); GetClipBox(graphics->hdc,&dstbox); TRACE("After ExtSelectClipRgn:%s,%s\n", wine_dbgstr_rect(&dstbox) );
The second %s here will print random memory.
}
It output in wine is : Before ExtSelectClipRgn:(693,5)-(763,28),(693,5)-(763,28) After ExtSelectClipRgn:(693,5)-(693,5)
But I think it should be output: Before ExtSelectClipRgn:(693,5)-(763,28),(693,5)-(763,28) After ExtSelectClipRgn:(693,5)-(763,28)
Where is my understanding mistake, or is it a bug in ExtSelectClipRgn?
Dear Thomas: It should be : TRACE("After ExtSelectClipRgn:%s\n", wine_dbgstr_rect(&dstbox) ); I want make the output clear so I remove the wine_dbgstr_rect(&srcbox), but I forgot remove the second %s. Thank you.
------------------ Original ------------------ From: "Thomas Faber"thomas.faber@reactos.org; Date: Mon, Dec 8, 2014 04:05 AM To: "Changhui Liu"liuchanghui@linuxdeepin.com; Cc: "Sebastian Lackner"sebastian@fds-team.de; "Vincent Povirk"madewokherd@gmail.com; "wine-devel"wine-devel@winehq.org; "洪谦"qhong@codeweavers.com; Subject: Re: Puzzle about ExtSelectClipRgn?
On 2014-12-03 03:36, Changhui Liu wrote:
Dear all, I test this code :
void test (HDC hdc, HRGN hregion) { RECT srcbox; RECT dstbox;
GetClipBox(hdc, &dstbox); GetRgnBox(hregion, &srcbox); TRACE("Before ExtSelectClipRgn:%s,%s\n", wine_dbgstr_rect(&srcbox), wine_dbgstr_rect(&dstbox) ); ExtSelectClipRgn(hdc, hregion, RGN_AND ); GetClipBox(graphics->hdc,&dstbox); TRACE("After ExtSelectClipRgn:%s,%s\n", wine_dbgstr_rect(&dstbox) );
The second %s here will print random memory.
}
It output in wine is : Before ExtSelectClipRgn:(693,5)-(763,28),(693,5)-(763,28) After ExtSelectClipRgn:(693,5)-(693,5)
But I think it should be output: Before ExtSelectClipRgn:(693,5)-(763,28),(693,5)-(763,28) After ExtSelectClipRgn:(693,5)-(763,28)
Where is my understanding mistake, or is it a bug in ExtSelectClipRgn?
------------------ Regards.