nightWatcher
nightWatcher

Reputation: 1051

Image C# file info

I have an app that captures image from webcam,I convert it to bitmap, now i want its info being read.

System.IO.FileInfo obj = new System.IO.FileInfo(@"C:\Users\Administrator\Desktop\Photo0250.jpg");

Instead of passing the path to file, I want to pass the bitmap i have.

Any ideas?

Or do I have to first save it to hard disk and the read it again? :(

Upvotes: 0

Views: 2545

Answers (1)

David
David

Reputation: 218837

Until it's been saved as a file, what exactly do you expect to get out of a FileInfo about it? Every property of that class directly relates to the file system properties of a file. (Except arguably .Length, but you should be able to get that from whatever your data stream is without having to round-trip to the file system and create unnecessary I/O.)

To directly answer your question, yes, you'll need to have a file on the file system in order to create an instance of FileInfo to get its file system properties. But I suspect there might be a deeper concern with which I can help depending on the actual needs of what you're trying to do. Taking a step back, why specifically do you need a FileInfo object in this case?

Upvotes: 3

Related Questions