Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6028787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:47:29+00:00 2026-05-23T04:47:29+00:00

I have an image in my project. In Solution Explorer, I’ve created a folder

  • 0

I have an image in my project.

In Solution Explorer, I’ve created a folder called “Resources” and I’ve added a single image in to that folder.

I want to set the image to the file in that folder. Here’s my C# code

BitmapImage splashScreenImageSource = new BitmapImage();
splashScreenImageSource.BeginInit();
splashScreenImageSource.UriSource = new Uri("world_splash.jpg", UriKind.Relative);
splashScreenImageSource.EndInit();            
splashScreenImage.Source = splashScreenImageSource;

When I run, nothing happens.

Here’s my XAML code

<Window x:Class="Bail.SplashScreen"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="256" Width="456" Background="#00005555" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterScreen" >
    <Grid Width="Auto">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>        
        <Image x:Name="splashScreenImage" Stretch="Fill" Grid.Row="0" />
    </Grid>
</Window>

Thank you for all your help.
Here is App.xaml if you needed to see

<Application x:Class="Bail.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         StartupUri="SplashScreen.xaml">
    <Application.Resources>

    </Application.Resources>
</Application>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:47:30+00:00Added an answer on May 23, 2026 at 4:47 am

    I think you have to specify the subdirectory in the image path. You said it’s in “Resources”. So try using:

    splashScreenImageSource.UriSource = new Uri("Resources/world_splash.jpg", UriKind.Relative);
    

    Edit: You have to set the file type to resource for this to work. If you want to have it as a file in the file system (instead of embedded in your assembly) you have to use a pack uri, like:

    splashScreenImageSource.UriSource = new Uri("pack://siteoforigin:,,,/Resources/world_splash.jpg", UriKind.Relative);
    

    In this case make sure the “Copy to output directory” option of the file is set.

    Also consider doing the initalization directly from XAML. It looks cleaner and requires less code:

    <Image x:Name="splashScreenImage" Stretch="Fill" Grid.Row="0" Source="Resources/world_splash.jpg" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that creates a disk image and would like to use
I have a django project in which a user will type in a url
• hello friends, • I have one solution say sol1 ’ which contain one
I have some problems adding my shader-glsl files from one xcode project to another.
I have a utility that draws a simple arc, either using SVG or, as
I have a problem that I would like to merge a large number of
I am working on a Django project in which users should be allowed to
So I have this small application of mine I'm trying to deploy using visual
In my project I'am working with images. I don't know how to organize the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.