Hey

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?

Thanks

Ok,

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
carPic.Save(addPicOpenFileDialog.FileName);

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);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.