In my custom component Paint method I want to paint just a region not the whole canvas because in the other region are other objects (like a scroll bar) and I don't want to draw over them. Is it possible ? Why on Earth they make the Canvas.ClipRect
read only ?
0
votes
1 Answers
3
votes
You can use ExcludeClipRect
to exclude regions from the clipping region. Pass the canvas Handle
as the device context. Call the function once for each scroll bar etc. whose region you wish to exclude.
Paint
method) ? Just copy it to a local variable and do with it what you need ;-) – TLamaClipRect
there (in thePaint
method), so I don't see why do you want to modify it there. It is as if someone would give you a cake and you'd try to re-bake it instead of eating. It is too late, the cake is baked there (and I wouldn't callExcludeClipRect
there; it's wasting of time, it would really be enough to copy it to a local variable and exclude that rectangle from that locally stored rectangle). – TLamawm_erasebkgnd
and now the canvas is all black, but it is still ALL painted. I want that region not by painted at all ! – Marus Nebunu