|
Hi,
How to read a jpeg image from the binary data in a file in C#? Here, image is stored as a bindary data in the file.Now i need to construct a image from this data.
|
|
|
|
|
Assuming that the data is a Jpeg file, just stored as binary:
byte[] bytes = File.ReadAllBytes(path);
MemoryStream ms = new MemoryStream(bytes);
Image returnImage = Image.FromStream(ms);
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
Thanks Griff..But this gives "Argument Exception" saying parameter is not valid.
|
|
|
|
|
Then I suspect that the data is not a jpeg file - what are you trying to do? Not "read a file as an Image, but what is the file? Why are you reading it? What are you trying to achieve? It may be that one of use is using the wrong terms!
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|