Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic GetBaseShapeDefinition doesnt exist in version 6 ? (Read 1663 times)
farshid
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Location: london
Joined: Jun 6th, 2013
GetBaseShapeDefinition doesnt exist in version 6 ?
Jun 6th, 2013 at 1:57pm
Print Post  
Hi

Is there any documentation for the breaking changes for update version 6.

I am trying to update to use the latest version of the MindFusion.Diagramming (6.0.2.23846).


Public Shared Sub Test(ByVal e As MindFusion.Diagramming.DrawLinkEventArgs)
     Dim headCoordinates As Single() = e.Link.GetBaseShapeDefinition.Coordinates
     Dim polygonPoints As New Generic.List(Of System.Drawing.PointF)
     While i < headCoordinates.GetUpperBound(0)
           polygonPoints.Add(New System.Drawing.PointF(headCoordinates(i), headCoordinates(i + 1)))
           i += 2
     End While
End Sub


My problem is that GetBaseShapeDefinition doesnt exist in the latest version. How do I access the Coordinates of the shape from the DrawLinkEventArgs?

Your help is very much appreciated.

Kind regards
Farshid
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: GetBaseShapeDefinition doesnt exist in version 6 ?
Reply #1 - Jun 6th, 2013 at 2:56pm
Print Post  
Hi,

The changes are listed here:
http://www.mindfusion.eu/onlinehelp/flowchartnet/index.htm?Moving_to_MindFusion_...

However this error probably happens because of an earlier change in v5.3.4, when the arrowhead property types were changed from enum Arrowhead to class Shape. Now you can enumerate the Shape.Outline elements and check their coordinates, but you will need to scale them from percents to values corresponding to the arrowhead size.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
farshid
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Location: london
Joined: Jun 6th, 2013
Re: GetBaseShapeDefinition doesnt exist in version 6 ?
Reply #2 - Jun 10th, 2013 at 10:29am
Print Post  
Hi

Thank you for your rapid reply. I don't understand what you mean by "but you will need to scale them from percents to values corresponding to the arrowhead size.” Below is the changes that I have made. Is this what you mean? I would appreciate if you could give an examples.

Public Shared Sub Test(ByVal e As MindFusion.Diagramming.DrawLinkEventArgs)
     Dim headCoordinates As PointCollection = e.Link.GetOutlinePoly(True)
     Dim polygonPoints As New Generic.List(Of System.Drawing.PointF)
     While i < e.Link.HeadShape.ShapeDecorations.GetUpperBound(0)
            polygonPoints.Add(headCoordinates(i))
            i += 1
     End While
     e.Graphics.FillPolygon(Brushes.Black, polygonPoints.ToArray())
End Sub

Thank you.

Kind regards,
Farshid
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: GetBaseShapeDefinition doesnt exist in version 6 ?
Reply #3 - Jun 10th, 2013 at 11:39am
Print Post  
Hi,

Do you need this only to draw the arrowhead from custom drawing code? You could use the static DrawArrowhead method for that:

Code
Select All
private void diagram_DrawLink(object sender, DrawLinkEventArgs e)
{
	var transparent = new System.Drawing.Pen(Color.Transparent);

	DiagramLink.DrawArrowhead(
		e.Graphics,
		transparent,
		Brushes.Black,
		e.Link.BaseShape,
		new PointF(50, 0),
		e.Link.ControlPoints[0],
		e.Link.ControlPoints[1],
		e.Link.BaseShapeSize,
		false);

	transparent.Dispose();
} 



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