Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic shape of shape node (Read 2066 times)
vchimakurthi
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 28
Joined: Apr 6th, 2011
shape of shape node
Aug 15th, 2011 at 3:02pm
Print Post  
hi
how can i change the shape of shape node to any image file
i set

snode.Image=aa.gif

snode.shape.image=aa.gif

image is inserted in side the node.. we dont want predefined shapes

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: shape of shape node
Reply #1 - Aug 15th, 2011 at 3:10pm
Print Post  
Hi,

Set ShapeNode.Transparent = true to hide the shape. Only the image and text will be displayed then.

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


I love YaBB 1G - SP1!

Posts: 28
Joined: Apr 6th, 2011
Re: shape of shape node
Reply #2 - Aug 16th, 2011 at 8:36am
Print Post  
hi i set the image attach a label to it .
its not attaching label at the bottom.


childNode.Image = imageList1.Images[index];
           childNode.Text = "";
           childNode.Transparent = true;
           ShapeNode label = diagram.Factory.CreateShapeNode(0, childNode.Bounds.Bottom, 10, 7);
           label.AttachTo(childNode, AttachToNode.BottomCenter);
           label.Text = name;
           label.TextFormat.LineAlignment = StringAlignment.Center;
           label.Transparent = true;
           label.Locked = true;
           
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: shape of shape node
Reply #3 - Aug 16th, 2011 at 8:45am
Print Post  
Hi,

AttachTo does not align the attached node to its master node, but just records their initial offset and preserves it when you move the master. So you will have to specify both the x and y coordinates relatively to the node:

CreateShapeNode(childNode.Bounds.Left, childNode.Bounds.Bottom, childNode.Bounds.Width, 7);

In case you are running some layout algorithm after that, enable the KeepGroupLayout property of the layout class, so that it does not move the labels away.

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