0

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

Edited by Klaurac: n/a

1
Contributor
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Klaurac
0

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.

0

Got it working

carPict = Image.FromFile(addPicOpenFileDialog.FileName);

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.