Re: Drawing Layers
jp2code wrote:
I'm trying to draw a custom object (a bar) in the shape of a rectangle.
The difficulty is that I want to add a border around it and a line over the
top of it.
Could I accomplish this with the memory CDC using successive Rectangles?
For example, if the rectangles below were of the appropriate size (large,
medium, and small)
CRect bigRect, regRect, lineRect;
And my memory CDC was selected and ready to go, would writing this code
produce my desired effect?
dc.Rectangle(&bigRect);
dc.Rectangle(®Rect);
dc.Rectangle(&lineRect);
The actual code is a little more involved, and I have not done it yet. It
will probably take me a full day to get all this figured out.
So, if this will *not* work, I would appreciate someone telling me in
advance!
All CDC functions work normally in a memory DC. Look for examples that
use CreateCompatibleDC. Incidentally, this has nothing to do with
"layers" as the term is used in Win32. It is simply drawing by using
multiple calls.
--
Scott McPhillips [MVP VC++]