Can anyone show me how can I set source to image from Resource in XAML. Currently I have
<Image x:Name="img" Panel.ZIndex="1" Source="D:\Img100.jpg" Stretch="Uniform"/>
I want Image Source to be come from Resources.
Thanks.
First you will have to include the image in your project with BuildAction Resource
Then you can use it directly in your Image
<Image Source="Img100.jpg"/>
Or make a reusable resource of the image
App.xaml (or other resource dictionary)
<Application.Resources>
<BitmapImage x:Key="myImage" UriSource="Img100.jpg" />
</Application.Resources>
Element:
<Image Source="{StaticResource myImage}" />