On Sat, 09 Apr 2005 10:19:36 +0200, you wrote:
Are you suggesting more checks then that the pixels are within the dimensions of the drawable?
you need at least to use the intersection of the bitmap and the drawable (not sure both start at (0,0) corner though).
I tried to do this, you need to clip to the visible region as well. I could not get it 100% full proof because of races between the clip calculations and the actual positions on the screen.
So I get the pixels now from the root window (clipped to the screen) and everything is rock solid. The code is simpler too.
I was also wondering what would happen when stretching is required, but IIRC this is done way before (normally)
Funny, in my tests StretchDIBits() with such bitmaps leaves black gaps (Wine2K and WinME) as long as you do not do a 1:1 stretch. With 1:1 stretches or using SetDIBitsToDevice I see the behavior as you described.
Changelog: dlls/x11drv : dib.c
In X11DRV_DIB_SetImageBits avoid BadMatch errors when calling XGetSubImage.
Rein.