Hi. Im using a picturebox to display some pictures. I m having a problem with giving the path of the picture. if the pictures are stored in a folder (pics) in .../bin/debug/pics/ . it is possible to give the complete url for the filder (F:\c#\MovieBase\MovieBase\bin\Debug\pics\xy.jpg). but if I m change the drive where the project is being developed (Ex:- F: to C:) i have to change the complete pathe again. is there any solution to give the location of the image without specifying the complete path.
Loading

Scott LysleRank #49 · 31K reputationPosted Jun 4, 2007, 4:11 PM EDT
You could do something like this:
this
.BackgroundImage = Image.FromFile(Application.StartupPath + "\\Graphics\\Binary.jpg");However, keep in mind that in debug or release mode the application will execute from the bin/debug or bin/release folder so you could do something like this for the time being:
this
.BackgroundImage = Image.FromFile(Application.StartupPath + "\\...\\...\\Graphics\\Binary.jpg");Todd Vance157 reputationPosted Jun 5, 2007, 8:43 AM EDT
Youda man!
Am I right in assuming that this way you could concatenate a series of images at the end of that statement ( i.e. - " \\blah\\blah\\" + images[i] +".jpg" ) -- or something like that.
Jan MontanoRank #1,295 · 1.3K reputationPosted Jun 6, 2007, 2:36 AM EDT
anushka thialkarathne15 reputationPosted Jun 11, 2007, 9:24 PM EDT