1

What I'm trying to do is have a collection of images stored in a media drive be dynamically changed once the user enters the images name in a text field. At the moment all I am able to do is load one singular image.

Is what I'd like to do even possible? If so, how can I go about doing it?

I'm extremely new to winform programming and my google searches haven't turned up much.

EDIT

Managed to fix the issue. The line of code I needed was as follows:

 pictureBox1.Image = Image.FromFile("Image Location");
That1Guy
  • 7,075
  • 4
  • 47
  • 59
N0xus
  • 2,674
  • 12
  • 65
  • 126

1 Answers1

1

If you mean the Embedded Resource

The answer is you can't modify the image under the Local Resource

Here's a good explanation: how to edit a resource file

Community
  • 1
  • 1
spajce
  • 7,044
  • 5
  • 29
  • 44
  • So there is no way I can change the image being displayed with a string message telling my program to load the specified image in a set location? For example, if I had a shoe.jpg being displayed. I would want to write ball.jpg and it would load the image, whilst getting rid of the old one. – N0xus Jan 30 '13 at 15:13
  • you can change your image(ex. for background a `Form` or `PictureBox`) but you can't modify or set the `Embedded Resource` dynamically. – spajce Jan 30 '13 at 15:16
  • The image would be displayed in a picture box. My program won't even touch the images in the file location. All it would do is know where to look for the image once the name had been passed to it. Is it possible that way? – N0xus Jan 30 '13 at 15:24
  • you're trying display all the selected images from your media drive to your `Form` or `PictureBox`? – spajce Jan 30 '13 at 15:29
  • Sorry I'm confused. Not sure if my original explanation was bad. At the moment my Form has a PictureBox. This picture box will only display one image. This image will change once I type in the name of a new image to be displayed which can be found in my media drive. Is that a bit clearer on what I'm trying to achieve? Sorry if it isn't. – N0xus Jan 30 '13 at 15:37
  • okay, now i understand.. so, can your share you codes? on how did you display the image to your `PictureBox`? – spajce Jan 30 '13 at 15:46