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 879257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:54:10+00:00 2026-05-15T11:54:10+00:00

My motivation for this question is really just to specify an image to be

  • 0

My motivation for this question is really just to specify an image to be used in a user control via a dependency property for ImageSource. I’m hitting some pain points involving the management, access, and unit testing for this.

  • Is the resource editor a good tool to use to maintain images for the application?
  • What is the best way to translate the Bitmap from the editor to an ImageSource?
  • How can I grab the resource Filename from the editor?
  • 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-15T11:54:11+00:00Added an answer on May 15, 2026 at 11:54 am

    No, the resource editor is not a good tool for this.

    In a WPF application the best way is to put all of your images in an “Images” directory and mark each one as a “Resource”. Then you can reference them directly in Image controls and elsewhere.

    Here are the precise steps:

    • Crop and otherwise adjust your images using your favorite bitmap editing program (Paint.NET, Photoshop, etc)
    • Save them as .png files (or .jpg or .gif if you prefer)
    • Create an “Images” folder inside your Visual Studio solution (or multiple folders, however you want to organize it)
    • Drag the images from your hard disk into your “Images” folder (or right-click the project, select New -> Existing Item and select the images)

    Now you can reference your images easily in XAML:

    <Image Source="Images/MyImage.png" />
    

    Or in code:

    var source = (BitmapSource)Application.LoadComponent(
                   new Uri("Images/MyImage.png", UriKind.Relative));
    

    You can also reference images in external assemblies:

    <Image Source="ReferencedAssembly;v1.0.0.1;component/Images/MyImage.png" />
    

    Which in code would be:

    var source = (BitmapSource)Application.LoadComponent(
                   new Uri("ReferencedAssembly;v1.0.0.1;component/Images/MyImage.png",
                     UriKind.Relative));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(in case you're curious about motivation: this will be used in a scons build
I guess so! EDIT: The motivation for this question is: It seems to me
The motivation for this was my answer (Wishful thinking) to an earlier question on
this might be a stupid question, but I'm using asp.net list control that creates
My primary motivation for asking this question is this uservoice suggestion . Jeff declined
EDIT: To explain my motivation for this, I'm writing a command-line utility that takes
I understand the cultural diversity motivation behind this ICAN decision but how disruptive is
I'm really drawing a blank on this one. I've been working on globalization but
This question was bugging me for quite a while (as evidenced by my previous
Update: I deleted my motivation because it seems to distract readers. This is not

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.