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???????

1 solution

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

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

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

I hope it helps.
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