none
Embedding Images RRS feed

  • Question

  • Hi,

    For this little application of mine, I was thinking about embedding the image file within my solution in Visual Studio 05 as a resource, instead of accessing the folder on my hard drive. I followed the steps of embedding the image as taught in MSDN, but for some reason after I click on Project->Add existing item..I don't get the option of having the image as an embedded resource.

    Can someone tell me how to actually get the image as an embedded resource and subsequently use it in my code.

    Thanks....

    Tuesday, August 1, 2006 10:11 PM

Answers

  • You don't need to bump so much.

    To add the image as an embedded resource, go to Project->Add existing item, as you said.  Change the file type dropdown to Image Files and select your image.  Then single-click on the image in the Solution Explorer, and in the properties pane, change the Build Action to "Embedded Resource."

    As for using it in code, the way I learned how is by setting an image property in the designer and looking at the generated code.  It shouldn't be hard to find examples of how to do this online.
    Thursday, August 3, 2006 4:10 AM

All replies

  • You don't need to bump so much.

    To add the image as an embedded resource, go to Project->Add existing item, as you said.  Change the file type dropdown to Image Files and select your image.  Then single-click on the image in the Solution Explorer, and in the properties pane, change the Build Action to "Embedded Resource."

    As for using it in code, the way I learned how is by setting an image property in the designer and looking at the generated code.  It shouldn't be hard to find examples of how to do this online.
    Thursday, August 3, 2006 4:10 AM
  • thanks

    Thursday, August 3, 2006 3:31 PM