Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Arrow Controlpoints (Read 1334 times)
Anil
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Mar 23rd, 2006
Arrow Controlpoints
Mar 23rd, 2006 at 2:19am
Print Post  
If I create a splitted/segmented arrow with the following code and try to select and move the arrow I get "Index out of range for PointCollection" collection.
Following is the code:

Arrow ar=flowchart.CreateArrow(startbox, -1,endbox, -1);
ar.ControlPoints.RemoveAt(0);
ar.ControlPoints.RemoveAt(0);
for(int i=0i<mycol.count;i++)
{
ar.ControlPoints.Add(mycol[i]);
}
ar.UpdateFromPoints();

mycol is collection of PointF objects that are saved previously from the same arrow.ControlPoints before deleting the arrow. I am try to recreate the arrow with the same split points. I know the reason is with SegmentCount not update properly. Can anyone advise me the proper way to recreate a split arrow so that when I move the arrow I do not get the exception messages like above.


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrow Controlpoints
Reply #1 - Mar 23rd, 2006 at 5:25am
Print Post  
Hi,

Save both the SegmentCount and Style properties values together with the PointF collection. When loading the arrow, first restore SegmentCount and Style and then restore the point coordinates.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint