J
jcreasy
So this is a really newbie question but I'll suck up my pride and
continue.
What is the best practice for including images, in this case .png's, in
a project. This is so I can do some fancy stuff with my GUI. I have a
bunch of .png's which I am setting as background images for controls. I
can add the image, set it to be an "embedded image" and use the
following line of code to set it as a background image.
<some control>.BackgroundImage = new Bitmap(typeof(myForm),
"imageName.png");
and that works just fine. The problem is I have a lot of images and a
lot of code files and it's just too dirty in my solution explorer. I
tried moving all of my images into a folder within the project, but the
only way I've been able to use my images is to have them copy to the
output folder and use the following line of code.
<some control>.BackgroundImage = new Bitmap("Images\\imageName.png");
The problem with this is the .exe has to be in the same folder as the
images folder. I prefer the embedded approach b/c all the user sees is
one .exe file.
So how do I use images in my project properly and keep it looking clean?
continue.
What is the best practice for including images, in this case .png's, in
a project. This is so I can do some fancy stuff with my GUI. I have a
bunch of .png's which I am setting as background images for controls. I
can add the image, set it to be an "embedded image" and use the
following line of code to set it as a background image.
<some control>.BackgroundImage = new Bitmap(typeof(myForm),
"imageName.png");
and that works just fine. The problem is I have a lot of images and a
lot of code files and it's just too dirty in my solution explorer. I
tried moving all of my images into a folder within the project, but the
only way I've been able to use my images is to have them copy to the
output folder and use the following line of code.
<some control>.BackgroundImage = new Bitmap("Images\\imageName.png");
The problem with this is the .exe has to be in the same folder as the
images folder. I prefer the embedded approach b/c all the user sees is
one .exe file.
So how do I use images in my project properly and keep it looking clean?