Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic recovering of box size problem. (Read 2403 times)
bemorem
YaBB Newbies
*
Offline


MacPro Xeon Quad

Posts: 44
Joined: May 3rd, 2007
recovering of box size problem.
Dec 5th, 2008 at 6:30am
Print Post  
Code
Select All
	  private void cmbShowID_SelectedIndexChanged(object sender, EventArgs e)
	  {
		RectangleF rr;
		foreach (Box bb in flowChart1.Boxes)
		{
		    //Get origin Rect(location & size)
		    rr = bb.BoundingRect;

		    if (cmbShowID.SelectedIndex == 0)
		    {
			  bb.FillColor = Color.Yellow;
			  bb.FrameColor = Color.Blue;
			  bb.Text = bb.Tag.ToString();
			  // resize to fit with text size
			  bb.FitSizeToText(FitSize.KeepRatio);
		    }
		    else
		    {
			  bb.FillColor = Color.White;
			  bb.FrameColor = Color.Black;
			  bb.Text = null;

			  // recover origin rect *********
			  bb.SetRect(rr, false);
		    }
		}
	  }
 



recovering original box size is not work...

what's wrong with above code?

origin image:
http://pic7.ohpy.com/up/elbbs/2008/12/05/161924/1666489379/mid_origin.jpg

fitsize2text image:
http://pic7.ohpy.com/up/elbbs/2008/12/05/161924/815196195/mid_before.jpg

recovering image(fail):
http://pic7.ohpy.com/up/elbbs/2008/12/05/161924/1229834194/mid_after.jpg
  

HW: MacPro Xeon Quad/ 4GB RAM&&OS: WinXP sp3 / .NET 3.5&&Dev: VS 2008 C# sp1&&flowchart .Net ver 4.3.x&&
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: recovering of box size problem.
Reply #1 - Dec 5th, 2008 at 10:19am
Print Post  
Isn't that the same as calling bb.SetRect(bb.BoundingRect)? This should not change the box size - does it change it?
  
Back to top
 
IP Logged
 
bemorem
YaBB Newbies
*
Offline


MacPro Xeon Quad

Posts: 44
Joined: May 3rd, 2007
Re: recovering of box size problem.
Reply #2 - Dec 8th, 2008 at 2:43am
Print Post  
Yes, Not Changed. As Shown in 3rd image Link.

What's the correct Method for that?

« Last Edit: Dec 8th, 2008 at 4:49am by bemorem »  

HW: MacPro Xeon Quad/ 4GB RAM&&OS: WinXP sp3 / .NET 3.5&&Dev: VS 2008 C# sp1&&flowchart .Net ver 4.3.x&&
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: recovering of box size problem.
Reply #3 - Dec 8th, 2008 at 9:25am
Print Post  
What exactly are you trying to do - recover the original size from before calling ResizeToFitText?
  
Back to top
 
IP Logged
 
bemorem
YaBB Newbies
*
Offline


MacPro Xeon Quad

Posts: 44
Joined: May 3rd, 2007
Re: recovering of box size problem.
Reply #4 - Dec 8th, 2008 at 10:02am
Print Post  
Yes It is.

Recovering Origina Size  & Location is purpose.

  

HW: MacPro Xeon Quad/ 4GB RAM&&OS: WinXP sp3 / .NET 3.5&&Dev: VS 2008 C# sp1&&flowchart .Net ver 4.3.x&&
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: recovering of box size problem.
Reply #5 - Dec 8th, 2008 at 12:28pm
Print Post  
You could save the BoundingRect rectangle from before calling ResizeToFit either as the box.Tag value, or in a hashtable that stores the original rectangle for each box. Then set box.BoundingRect = (RectangleF)box.Tag or box.BoundingRect = (RectangleF)orgRects[box].

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint