Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Add star or any small image on the top of diagram shape (Read 1435 times)
Sivaraj p
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Mar 14th, 2013
Add star or any small image on the top of diagram shape
Jul 11th, 2014 at 12:06pm
Print Post  
Hi ,

Please help me  to add a small shape(or a star character) in the corner of diagram shape in wpf diagramming
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Add star or any small image on the top of diagram shape
Reply #1 - Jul 11th, 2014 at 1:33pm
Print Post  
Hi,

You could assign a star image to the ShapeNode.Image property if you don't use it for anything else. Otherwise you could custom draw it from DrawNode event handler, e.g. by calling DrawingContext.DrawImage, or by drawing shape geometries:

Code
Select All
private void diagram_DrawNode(object sender, DrawNodeEventArgs e)
{
	e.Graphics.PushTransform(new TranslateTransform(10, 10));
	e.Graphics.PushTransform(new ScaleTransform(0.2, 0.2)); // map from shape % coordinates to 20 point size

	Shapes.Star6Pointed.Draw(
		e.Graphics, Brushes.Yellow, null, 0);

	e.Graphics.Pop();
	e.Graphics.Pop();
} 



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