Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic 5) Resize the node as per image and text. (Read 1780 times)
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
5) Resize the node as per image and text.
Dec 27th, 2017 at 6:55am
Print Post  
We need to create node in such way that, It resize as image and text shown inside it.
  

Image3.png (Attachment deleted)
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: 5) Resize the node as per image and text.
Reply #1 - Dec 27th, 2017 at 8:24am
Print Post  
Call node.resizeToFitText to fit the text. Try this for finding image size in diagram's units and apply the found size to node's Bounds -

Code
Select All
var scale = GraphicsUnit.getPixel(diagram.getMeasureUnit());
var imgSize = { x: image.width * scale, y: image.height * scale };
node.setBounds(...); 



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