BitBlt() Bug with Backbuffer

Hey there,
I have a window with a backbuffer and it's doing something strange and I don't understand how.

When I present the backbuffer to the window it has a dark grey border around the edge of the client area, which is being produced by the backbuffer.

I cannot figure out where this border is coming from. It doesn't make sense because my BitBlt() is:
1
2
3
BitBlt(hWndDC, 0, 0, ClientWidth, ClientHeight,
       hSrcDC, 0, 0,
       SRCCOPY); // just an example 
(Where the backbuffer is the same demensions as the client area)

The border is equal all the way around the client area, which is the most confusing of all. If I had simply got the width and height of the client area wrong, it wouldn't have an equal edge all the way round...

Here's a image of the window:
http://i233.photobucket.com/albums/ee74/Lightfooted/Public/windowError.jpg

You'll notice the slightly thicker than normal client area border.
What could cause this?
You're not drawing to a control or anything that has a border style?

How are you clearing the backbuffer?
After fiddling around a bit, I found I had to increase the size of the backbuffer to two pixels larger that the client window in both demensions.

And then:
1
2
3
BitBlt(hWndDC, -1, -1, ClientWidth +2, ClientWidth + 2,
       hSrcDC,  0,  0,
       SRCCOPY); // just an example 
Strange.

I do seem to remember something about the client area always being +1 in both dimensions, when you retrieve the client area.

Why is that the case?
It's probably just for convenience.

But this is not normal behavior, so I suspect there's something wrong elsewhere in your code.
Last edited on
Topic archived. No new replies allowed.