I have a rectangle with a 1px black border and rounded corners drawn
with CDC::RoundRect that I want to use as a clipping region. All
drawing and filling should happen within this rectangle. So I did:
dc.RoundRect(rectClient, CPoint(9, 9));
CRgn rgnClip;
rgnClip.CreateRoundRectRgn(rectClient.TopLeft().x + 1,
rectClient.TopLeft().y + 1,
rectClient.BottomRight().x,
rectClient.BottomRight().y,
9, 9);
If I don't add the +1 to the top-left coordinates, the clipping region
includes the left and top borders. However, with the 1 added, filling
operations miss out a handful of pixels in the top left and bottom left
corners.
How can I set a clipping region that corresponds exactly to the area
bounded by the rectangle borders?
Thanks,
Erik