Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Image positioning for shape nodes (Read 4075 times)
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
Image positioning for shape nodes
Apr 29th, 2013 at 9:31am
Print Post  
Hi

How can i place an image exactly on the left corner of a shape node. I want to show a tick mark image on that position. Also is there any possibility to show multiple image over a shape node? For example i need to show 4 tick mark images on the 4 corners of a rectangular shape node. Is that possible by any way in mindfusion MVC diagramming.

Also can i show some images horizontally stacked over the caption area of a container node?
This is really needed for me to convey some additional attributes of the shape to the end user in a visual way.

Thanks
Kiran B
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Image positioning for shape nodes
Reply #1 - Apr 29th, 2013 at 12:14pm
Print Post  
Hi,

You can align ShapeNode.Image to top-left corner by setting the ImageAlign property to TopLeft.

You can custom draw additional images by adding them from onUpdateVisuals function:

Code
Select All
var imageObj = new Image();
imageObj.src = "icon1.png";

startNode.onUpdateVisuals = function (node)
{
	var image2 = new MindFusion.Drawing.Image(
		new MindFusion.Drawing.Rect(node.bounds.x, node.bounds.y, 5, 5)); // 5mm at top left
	image2.image = imageObj;
	image2.loaded = imageObj.complete;
	node.graphicsContainer.content.push(image2);
}; 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
Re: Image positioning for shape nodes
Reply #2 - May 1st, 2013 at 6:20pm
Print Post  
Hi Stoyan,

What is this startNode?

Thanks
Kiran B
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Image positioning for shape nodes
Reply #3 - May 2nd, 2013 at 7:06am
Print Post  
Hi,

It's just some node I have in my test project. You can add this function to individual nodes if you need each one to draw different custom graphics, or add it to the prototype to draw the same graphics for all nodes.

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