locked
Cannot find image file after publishing app RRS feed

  • Question

  • I've added this code to my WF project.

    Bitmap bm = (Bitmap)Image.FromFile("backbill3.bmp");

    I need access to the image so as to identify transparent regions within it.

    backbill3.bmp has already been added to my project and is used as the background image for image for a form.

    This all works fine when I'm debugging in VS. However when I publish the app I get the following error message, "FileNotFoundException was unhandled" backbill3.bmp.

    How do I make this file accessible to my code after publication?

    Sunday, August 8, 2010 9:15 AM

Answers

  • OK solution was in fact very simple,

    just changed above to,

    Bitmap bm = (Bitmap)BackgroundImage;

    Where BackgroundImage is the object created by V.S. to hold "backbill3.bmp" as the background image for the form.

    Tony.

    • Marked as answer by Tony Doull Sunday, August 8, 2010 9:31 AM
    Sunday, August 8, 2010 9:31 AM