Your code is blt'ing a solid black square, which is totally symetrical and might be giving confusing results.

Try again with a shape (or line sequence) that is completely asymetrical, and you might gain a better understanding of what's happening.

Incidentally, I have no direct knowledge of what you're trying to accomplish, but isn't it also necessary to call SetWindowOrg()?

Mike