G
gsmith
Hello,
I am developing a video recording (mjpeg) system which records large
binary files. I need to read the JPEG data from the binary file and
create a bitmap object to be displayed. Unfortunately I cannot find an
efficient way to do this in C#. I need to do this at 10fps+ with 1hour+
data files.
My current approach is read a byte[] from the filestream, then create a
MemoryStream to the created byte[] and then a bitmap from the memory
stream. This seems very excessive and is quite CPU and memory
intensive.
A bitmap constructor like this would be great:
public Bitmap(byte[] data, Int32 startIndex, Int32 length)
OR
public Bitmap(Stream s, Int32 startIndex, Int32 length)
Sadly it looks like the .NET developers weren't thinking about files
like the ones my system will be creating.
Anyone know of an effective/efficient way to load Bitmaps from a binary
file?
Thanks!
Greg
I am developing a video recording (mjpeg) system which records large
binary files. I need to read the JPEG data from the binary file and
create a bitmap object to be displayed. Unfortunately I cannot find an
efficient way to do this in C#. I need to do this at 10fps+ with 1hour+
data files.
My current approach is read a byte[] from the filestream, then create a
MemoryStream to the created byte[] and then a bitmap from the memory
stream. This seems very excessive and is quite CPU and memory
intensive.
A bitmap constructor like this would be great:
public Bitmap(byte[] data, Int32 startIndex, Int32 length)
OR
public Bitmap(Stream s, Int32 startIndex, Int32 length)
Sadly it looks like the .NET developers weren't thinking about files
like the ones my system will be creating.
Anyone know of an effective/efficient way to load Bitmaps from a binary
file?
Thanks!
Greg