Click here to Skip to main content
15,936,504 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
I am very much new in Silverlight,in my web application developed i want to show an image in my window,for that i have put my image path on the XAML as "image\DSC_0340.JPG",but on putting this i can see the image in the designer but when i execute this the image is not shown in my output page.
i don't know why is it like this,Anybody please help me on this....
Posted

The image source URI will vary depending on where the image file is hosted.

For example, an image file named "myimage.png" in a project folder called "Images" with the image's build action set to "Resource" you can use something like this:
<Image Source="Images/myimage.png" /> 


Check this out for more examples...

Different ways for loading images and files in Silverlight 2 applications[^]
Silverlight - Resources from XAP/DLL/Site Of Origin[^]
 
Share this answer
 
Comments
Espen Harlinn 21-Jul-11 5:12am    
Good reply, my 5
Have a look at this[^] article.
It should help you out. Its all about getting the relative URI right!
 
Share this answer
 
Comments
Espen Harlinn 21-Jul-11 5:11am    
It should, my 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900