Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Set backround image to the diagram (Read 3178 times)
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Set backround image to the diagram
Mar 24th, 2009 at 3:30pm
Print Post  
Hi,
I'm trying to set backroud image to my diagram.

<my:Diagram x:Name="diagramLight" AlignToGrid="True" Behavior="LinkShapes" LinkBrush="Green" NodeClicked="diagramLight_NodeClicked" Background="#FF5C7590" >


<Image x:Name="backImage" Source="file:///C:/Untitled.jpg"></Image>

</my:Diagram>

I see the image in the preview but when i browse to the page i dont see it.

also i tried to se image to shape node and didnt successed.
shape1.Image = new BitmapImage(new Uri("file:///C:/Untitled.jpg"));

i got -
invalidoperationexception imageerror error #4001

Thanks,

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Set backround image to the diagram
Reply #1 - Mar 24th, 2009 at 6:52pm
Print Post  
Hi,

I suppose that Xaml code tries to set an Image control as the Content of the Diagram control, which does not work because the Diagram later sets a Canvas that contains the items as its Content. Instead, try setting the BackBrush to an ImageBrush that shows your image. To load an image, add it to your project so it's built into the .xap file, and load it just by the file name, without a path in front of the name.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Set backround image to the diagram
Reply #2 - Mar 25th, 2009 at 8:13am
Print Post  
Hi,

can you please send me example?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Set backround image to the diagram
Reply #3 - Mar 25th, 2009 at 10:09am
Print Post  
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint