"Reiner Obrecht" <(E-Mail Removed)> wrote in message
news:732D13C5-70EE-4CA2-8234-(E-Mail Removed)...
>I save my old cliping region and do some work with a new clipping region.
> When I want to switch back I get another clipping region contents in my
> Graphics object than before. The saved region in "oldClip" is still
> correct.
How do you know the saved region is "still correct"?
> Region oldClip = g.Clip;
> g.Clip = new Region(path); // new region is perfect
>
> // several drawings which are correct ....
>
> g.Clip = oldClip; // it happens here
>
> Has anyone an idea, where the problem can come from? Thanks for helping.
Not really. Everything looks good at first glance, but then I use the
SetClip() method and not the Clip property when dealing with clipping
regions, so I can't say I have any experience with cases like yours. (Not to
mention that I haven't yet had a need to save an existing clipping region.)
How about cloning? Make the first line
Region oldClip = (Region)g.Clip.Clone();
|