On Apr 25, 2005, at 13:49, Bryan Pietrzak wrote:
Not really. Not with the model of draw and forget.
What are trying to do with InvertRect? There may be a different
approach to the problem you can use.
When elements are selected in Creator (our page layout app), they
have handles. We've always used InvertRect to draw these handles,
because that ensures they're always visible no matter what's being
the handle. Simply drawing a black square won't work because the
entire background could be black. Under certain conditions (a
contained element is selected), we also use a "hollow" handle, which
is a white background with a 1px black frame, so using that somewhat
common method already has a meaning in Creator.
There's also the problem that I haven't even looked at yet of
drawing an outline when new elements are in the process of being
created by dragging out their bounds with a tool. Also, when
resizing an existing element, we draw with a pattern for the outline
being rubber banded around. Both methods use xor drawing to draw the
new path and erase the old path. Live drawing of the actual shape
*could* be used instead, but it could be very slow if the shape is
complex (100-point starburst with round valleys and peaks), and we'd
have to draw the entire spread for every mouse movement. That could
be painfully slow in this situation as there could be hundreds and
hundreds of text, graphic, or shape elements.