Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic CustomLink drawing on bezier curves (Read 1741 times)
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
CustomLink drawing on bezier curves
Sep 3rd, 2014 at 10:26pm
Print Post  
I want to use customdraw on links using the bezier shape. More specifically, I want to draw a sort of 'border' around a diagram link so that it looks like it is three stripes (one color in the middle and two on the outside). How can I accomplish this?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: CustomLink drawing on bezier curves
Reply #1 - Sep 4th, 2014 at 7:40am
Print Post  
Try this:
Code
Select All
private void diagram_DrawLink(object sender, DrawLinkEventArgs e)
{
	if (e.Shadow || e.Link.Shape != LinkShape.Bezier)
		return;

	var points = e.Link.ControlPoints.GetArray();

	using (var borderPen = new System.Drawing.Pen(Color.Red, 1 /* mm */))
		e.Graphics.DrawBeziers(borderPen, points);

	using (var stripePen = new System.Drawing.Pen(Color.Beige, 0.4f  /* mm */))
		e.Graphics.DrawBeziers(stripePen, points);
} 

  
Back to top
 
IP Logged
 
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
Re: CustomLink drawing on bezier curves
Reply #2 - Sep 5th, 2014 at 8:02pm
Print Post  
That worked, thank you.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint