Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Multiple images in one ShapeNode (Read 199 times)
Kuzya
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 48
Joined: Dec 19th, 2011
Multiple images in one ShapeNode
Apr 16th, 2025 at 12:57pm
Print Post  
Hello,
Is it possible to add two images to one ShapeNode? One image at the bottom right and another at the top right.


Regards,
Kuzya
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3371
Joined: Oct 19th, 2005
Re: Multiple images in one ShapeNode
Reply #1 - Apr 16th, 2025 at 2:09pm
Print Post  
Hi,

Try code here -

https://mindfusion.eu/Forum/YaBB.pl?num=1488530760/4#4

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Kuzya
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 48
Joined: Dec 19th, 2011
Re: Multiple images in one ShapeNode
Reply #2 - Apr 16th, 2025 at 2:51pm
Print Post  
Thank you
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3371
Joined: Oct 19th, 2005
Re: Multiple images in one ShapeNode
Reply #3 - May 1st, 2025 at 7:40am
Print Post  
This build adds image and imageLocation properties to ItemLabel, similar to the ones in ShapeNode:

https://mindfusion.eu/_beta/jsdiag47.zip

Code
Select All
var node = diagram.factory.createShapeNode(10, 10, 40, 30);
node.shape = Shape.fromId("Rectangle");

var icon1 = node.addLabel();
icon1.setCornerPosition(1, 0, 0);
icon1.horizontalAlign = Alignment.Far;
icon1.verticalAlign = Alignment.Near;
icon1.imageLocation = "icon1.png";
icon1.margin = new Thickness(0, 0, 0, 0);
icon1.imageSize = new Size(10, 10);

var icon2 = node.addLabel();
icon2.setCornerPosition(2, 0, 0);
icon2.horizontalAlign = Alignment.Far;
icon2.verticalAlign = Alignment.Far;
icon2.imageLocation = "icon2.png";
icon2.margin = new Thickness(0, 0, 0, 0);
icon2.imageSize = new Size(10, 10); 



Code above will be the official method of displaying multiple images per node going forward, instead of custom-drawing callbacks. The same properties should work for displaying images along a DiagramLink.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint