Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem with Left ImageAlign (Read 2045 times)
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Problem with Left ImageAlign
Jun 3rd, 2009 at 9:02am
Print Post  
Hi Stoyan,

I want some space from the left while displaying Image at left side. I want to align the image at left side but want some space between node's boundary and Image. The code example of problem is given below.


Code
Select All
	ShapeNode Node = diagram.Factory.CreateShapeNode(100,200,50,50);

		    Node.Shape = Shapes.Rectangle;
		    Uri uri = new Uri(somePath);
		    Node.Image = new BitmapImage(uri);
		    Node.ImageAlign = ImageAlign.MiddleLeft;
 



Please give your suggestion.

Thanks,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with Left ImageAlign
Reply #1 - Jun 3rd, 2009 at 9:49am
Print Post  
Assuming you are using the Rectangle shape, set Shapes.Rectangle.ImageRectangle to new Rect(5, 5, 90, 90) at application startup.

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


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Problem with Left ImageAlign
Reply #2 - Jun 3rd, 2009 at 12:21pm
Print Post  
Hi Stoyan,

Thanks for quick reply.

According to your reply,I have used:
Code
Select All
Shapes.Rectangle.ImageRectangle = new Rect(rect.X - 5, rect.Y - 5, rect.Width - 10, rect.Height - 10);

	     ShapeNode mainNode = new ShapeNode();
	     diagram.Nodes.Add(mainNode);
	     mainNode.Bounds = rect;// diagram.Factory.CreateShapeNode(rect);
	     mainNode.Shape = Shapes.Rectangle;
	     mainNode.Brush = Brushes.Red;
	     mainNode.Image = new BitmapImage(new Uri(@"..\..\Encoder.png", UriKind.RelativeOrAbsolute));
	     mainNode.ImageAlign = ImageAlign.MiddleLeft; 



But now, I am unable to see Image in my Node.
Am I doing something wrong?Please suggest.

Thanks,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with Left ImageAlign
Reply #3 - Jun 3rd, 2009 at 12:42pm
Print Post  
All coordinates in Shape definitions are specified in percents, so the ImageRectangle values should be in the 0..100 range.

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