Rein Klazes wijn@wanadoo.nl writes:
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.
That's ugly, and it will fail miserably if the drawable is a bitmap, you really have to use the specified drawable. Look at how the BitBlt code does it to determine the proper limits.