Click here to Skip to main content
15,348,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have added one image file in the project using "Add new item" option.

Now when I have added below code. it shows image at compile time.
<Image x:Name="ImageTimeLine" Source="/TimeLine.TIF"></Image>


But @ runtime it does not show an image.

Does any body have any idea???????
Posted

1 solution

Hi Add the image to project and set its "Build action" to "Resource".
XAML:
Like this:
<image x:name="ImageTimeLine" source="/TimeLine.TIF" xmlns:x="#unknown"></image>

or
<image x:name="ImageTimeLine" source="/<b>ASSEMBLY_NAME</b>;component/TimeLine.TIF" xmlns:x="#unknown"></image>

or
<image x:name="ImageTimeLine" source="pack://application:,,,/TimeLine.TIF" xmlns:x="#unknown"></image>


I hope it helps.
   
Comments
Sujeet Pardeshi 6-Apr-12 0:13am
   
Yes the second solution works. Thanks...:):)

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