PC Review


Reply
Thread Tools Rate Thread

Cannot go back to old clip region

 
 
Reiner Obrecht
Guest
Posts: n/a
 
      8th Apr 2009
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.

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.


 
Reply With Quote
 
 
 
 
Jeff Johnson
Guest
Posts: n/a
 
      8th Apr 2009
"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();


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      10th Apr 2009
"Jeff Johnson" <(E-Mail Removed)> schrieb:
> 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.)


Setting the 'Clip' property will cause the following call: 'Me.SetClip(<new
value>, CombineMode.Replace)'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clip art as a back ground =?Utf-8?B?TWVsb2R5QW5uZQ==?= Microsoft Powerpoint 2 7th Sep 2007 08:28 AM
Clip a Graphics region Manuel Microsoft ASP .NET 3 10th Jun 2007 03:33 PM
Problems changing back to Region 2 Kamal Windows XP Hardware 4 9th Jul 2005 02:13 AM
How to get control clip region? Julie Microsoft C# .NET 2 16th Apr 2005 12:43 PM
Modifying clip region Martin Microsoft C# .NET 3 14th Feb 2005 01:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:48 AM.