L
Laurent Navarro
Hello,
I am using a library which returns a byte[] containing RAW data, ie all
pixels' color values coded in a byte array without header. I would like to
save those data into a JPEG file so I tried to use the MetaFile class.
byte[] data;
(...) // Creating the RAW image through the DLL call.
MemoryStream memoryStream = new MemoryStream(data);
MetaFile metaFile = new MetaFile(memoryStream);
Unfortunately, this code throws an exception which description is: "GDI+
encounters an internal error". I also tried this:
byte[] data;
(...) // Creating the RAW image through the DLL call.
MemoryStream memoryStream = new MemoryStream(data);
Image image = Image.FromStream(memoryStream);
This time I have an ArgumentException. I guess I can't use a stream
linking to RAW data as it is not an image with header. But then, how can I
make the MetaFile class read my data and convert them to JPEG file ???
Thank you !
Laurent
I am using a library which returns a byte[] containing RAW data, ie all
pixels' color values coded in a byte array without header. I would like to
save those data into a JPEG file so I tried to use the MetaFile class.
byte[] data;
(...) // Creating the RAW image through the DLL call.
MemoryStream memoryStream = new MemoryStream(data);
MetaFile metaFile = new MetaFile(memoryStream);
Unfortunately, this code throws an exception which description is: "GDI+
encounters an internal error". I also tried this:
byte[] data;
(...) // Creating the RAW image through the DLL call.
MemoryStream memoryStream = new MemoryStream(data);
Image image = Image.FromStream(memoryStream);
This time I have an ArgumentException. I guess I can't use a stream
linking to RAW data as it is not an image with header. But then, how can I
make the MetaFile class read my data and convert them to JPEG file ???
Thank you !
Laurent