Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Box location (Read 3694 times)
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Box location
Nov 14th, 2006 at 8:06am
Print Post  
Stoyan,

Seems quite trivial, but please tell me how do i get the position of the box on the flowchart.

I could not see anything as Box.location, Box.X, Box.Y or something like this on the Box object.

Please let me know.
Thanks in advance

Cheers

Phil
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Box location
Reply #1 - Nov 14th, 2006 at 8:13am
Print Post  
Hello Phil,

Use the box.BoundingRect property.

Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Box location
Reply #2 - Nov 14th, 2006 at 8:17am
Print Post  
Stoyan,

That gives me the RectangleF, whereas i would want a PointF of the center of the box.

Phil
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Box location
Reply #3 - Nov 14th, 2006 at 8:30am
Print Post  
Ok Got that ..... from the RectangleF i can compute the upper left cooordinates and use the width and height to get the center of the Box.

I was thinking whether i could get these directly.

Being a bit lazy ... Cheesy

Thanks a ton

Phil
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Box location
Reply #4 - Nov 14th, 2006 at 8:36am
Print Post  
Here's a method from the control's source code, so you don't get tired  8)

internal static PointF getCenter(RectangleF rect)
{
  return new PointF(rect.X + rect.Width / 2, rect.Y + rect.Height / 2);
}

Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Box location
Reply #5 - Nov 14th, 2006 at 8:49am
Print Post  
Stoyan,

Thanks a ton .... u know what, i was wondering to call up a consultant on how would i get the center of the bounding rectangle from upper left corner.

Thanks for saving my money .... U r genius  Cheesy Wink

Phil
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Box location
Reply #6 - Nov 14th, 2006 at 9:51am
Print Post  
Grin
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint