Marus Gradinaru
Marus Gradinaru

Reputation: 3120

Is it possible to shrink the clipping rectangle in Paint method?

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 ?

Upvotes: 0

Views: 373

Answers (1)

David Heffernan
David Heffernan

Reputation: 613531

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.

Upvotes: 3

Related Questions