Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to set a image in link (Read 1903 times)
kdr35
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 12th, 2010
How to set a image in link
Dec 15th, 2010 at 10:15am
Print Post  
Hi,

I want to set different images on links to display different link type. Is there any way to that or is it possible?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to set a image in link
Reply #1 - Dec 15th, 2010 at 11:16am
Print Post  
Hi,

If you mean bitmap images, you can custom-draw them by setting the links' CustomDraw property and handling the DrawLink event. Or if you need to change the arrowhead to a custom vector image, use the Shape Designer tool to draw it, copy the code and assign the shape to link.HeadShape.

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


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 12th, 2010
Re: How to set a image in link
Reply #2 - Dec 15th, 2010 at 12:16pm
Print Post  
I want to do thing as below image

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to set a image in link
Reply #3 - Dec 15th, 2010 at 1:11pm
Print Post  
Try this:

Code
Select All
private void diagram_DrawLink(object sender, DrawLinkEventArgs e)
{
	Image bmp = ...
	PointCollection points = e.Link.ControlPoints;
	PointF start = points[0];
	PointF end = points[1];
	RectangleF imgSize = diagramView.ClientToDoc(new Rectangle(new Point(), bmp.Size));
	e.Graphics.DrawImage(bmp,
		(start.X + end.X - imgSize.Height) / 2,
		(start.Y + end.Y) / 2 - imgSize.Height - 2);
} 

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