I have a videorental program and each video object should have an display image.

private Image VideoPicture;

I searched the web for tutorials, but couldn't find any.
I know how to use the file input dialog, but how do I assign the image to the CarPicture.
I haven't figured out the terms, I have seen BitMap class used.
What is this? Shouldn't I use Image class?

Or should I save only paths to the images?


Edited 6 Years Ago by Klaurac: n/a


I've gotten to the point where I select the image file.
Now I need to assign the image to the image declaration in my object.

How do I do it?

Image carPic;

I tried

This won't give error on declaration but on runtime it gives me:

System.NullReferenceException was unhandled
Object reference not set to an instance of an object.

What does it mean? I've got the carPic declared. It says its null, but it shouldn't be anything else then null at first.

Got it working

carPict = Image.FromFile(addPicOpenFileDialog.FileName);

This question has already been answered. Start a new discussion instead.