Open an image

Mickeys used Ask the Experts™
Instead of writing the hole search way to a file I would just like the program to know that it will get the image in the project. How do I write that?

Right now I need to do this
Bitmap cardImage = new Bitmap("C:\\Documents and Settings\\MFL\\Dokumenter\\Visual Studio 2008\\Projects\\Black_Jack\\Black_Jack\\images\\53.gif");
            backImage = cardImage;

I want to be able to run the app on diffrent computers
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Digital Marketing (Hospitality)
Hi Mickeys,
You can get the current program's drive via .net built-in function called "".
Bitmap cardImage = new Bitmap(Directory.GetCurrentDirectory() + "\\images\\53.gif");

Check this site for further details regarding mentioned:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial