We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How do i implement middle arrow to the link

Thread ID:

Created:

Updated:

Platform:

Replies:

23290 Jan 7,2005 10:05 PM Jan 12,2005 12:29 PM Windows Forms 3
loading
Tags: Diagram
suwit
Asked On January 7, 2005 10:05 PM

Hi does anyone success on implement middle arrow into the link ?

Administrator [Syncfusion]
Replied On January 11, 2005 04:19 PM

Hi Suwit, I am assuming you are referring to creating a custom Link type. To customize the Link drawing, implement a subclass of the Syncfusion.Windows.Forms.Diagram.Link class with an appropriate override of the Link.CreateLinkShape(Link.Shapes shapeType, PointF[] pts) method that renders the link. A sample override is shown below, // Override the Link.CreateLinkShape method in a Link subclass protected override IPoints CreateLinkShape(Link.Shapes shapeType, PointF[] pts) { Shape linkShape = null; if(shapeType == Link.Shapes.Arc) { OrthogonalLine orthogonalLine = new OrthogonalLine(); orthogonalLine.AutomaticHeadings = true; linkShape = orthogonalLine; } if(linkShape != null) { linkShape.SetPoints(pts); } return linkShape; } Now to use your Link class all that is required is to provide a suitable LinkFactory delegate to the LinkTool that create the Link type that you have defined. A sample implementation as used in the DiagramBuilder sample is shown below, // Create and register a tool for arc links LinkTool arcLinkTool = new LinkTool("ArcLinkTool"); arcLinkTool.LinkFactory = new LinkFactory(this.CreateArcLink); this.diagram.Controller.RegisterTool(arcLinkTool); // Implement the LinkFactory delegate protected Link CreateArcLink(PointF[] pts) { Link link = new Link(Link.Shapes.Arc, pts); return link; } I hope this helps. Regards, Prakash

suwit
Replied On January 12, 2005 09:40 AM

Thanks, but??? where is middle arrow in the code? >Hi Suwit, > >I am assuming you are referring to creating a custom Link type. To customize the Link drawing, implement a subclass of the Syncfusion.Windows.Forms.Diagram.Link class with an appropriate override of the Link.CreateLinkShape(Link.Shapes shapeType, PointF[] pts) method that renders the link. A sample override is shown below, > >// Override the Link.CreateLinkShape method in a Link subclass >protected override IPoints CreateLinkShape(Link.Shapes shapeType, PointF[] pts) >{ > Shape linkShape = null; > if(shapeType == Link.Shapes.Arc) > { > OrthogonalLine orthogonalLine = new OrthogonalLine(); > orthogonalLine.AutomaticHeadings = true; > linkShape = orthogonalLine; > } > > if(linkShape != null) > { > linkShape.SetPoints(pts); > } > > return linkShape; >} > >Now to use your Link class all that is required is to provide a suitable LinkFactory delegate to the LinkTool that create the Link type that you have defined. A sample implementation as used in the DiagramBuilder sample is shown below, > >// Create and register a tool for arc links >LinkTool arcLinkTool = new LinkTool("ArcLinkTool"); >arcLinkTool.LinkFactory = new LinkFactory(this.CreateArcLink); >this.diagram.Controller.RegisterTool(arcLinkTool); > >// Implement the LinkFactory delegate >protected Link CreateArcLink(PointF[] pts) >{ > Link link = new Link(Link.Shapes.Arc, pts); > return link; >} > >I hope this helps. > >Regards, >Prakash

Administrator [Syncfusion]
Replied On January 12, 2005 12:29 PM

Suwit, That bit of code was provided just to help you get started with the implementation for custom drawing the ''link middle arrow''. In your custom Link class''s override of the CreateLinkShape() method, you will have to interpret the PointF collection and draw the link(with the middle arrow) as required. Unfortunately, we do not have any code available that shows rendering a Link with such a middle arrow. Thanks, Prakash Surendra

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;