Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Need Bounds of node after DoubleAnimation (Read 1987 times)
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Need Bounds of node after DoubleAnimation
Jun 2nd, 2009 at 6:28am
Print Post  
Hi Stoyan,

I have applied DoubleAnimation for nodes in my diagram.When Node animate it grows in length and width.I want these new bounds of node(height and width).I am trying to acheive the same but getting that old bounds.

Please give some suggestions on this.

Thanks,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need Bounds of node after DoubleAnimation
Reply #1 - Jun 2nd, 2009 at 12:11pm
Print Post  
If you animating the node's RenderTransform, that won't change Bounds. The width and height of the rendered node at the end of the animation should be the old width and height multiplied by the final value of the animation. Assuming you are using the sample code from a few weeks ago, the centers of the old and new rectangles should coincide, so you can find the rectangle like this

Code
Select All
Rect r = node.Bounds;
Point c = new Point(r.X + r.Width / 2, r.Y + r.Height / 2);
double w = r.Width * finalScaleX;
double h = r.Height * finalScaleY;
Rect renderedRect = new Rect(c.X - w / 2, c.Y - h / 2, w, h);
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Need Bounds of node after DoubleAnimation
Reply #2 - Jun 2nd, 2009 at 3:18pm
Print Post  
Thanks Stoyan, its working Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint