In a .NET CF application I wrote, one of the features is to acquire frames from remote cameras. Frames are acquired as single jpeg images and displayed on the screen when available.
It was a good enough solution, but I don’t like the fact that the time needed to convert the stream into an Image object, with the Bitmap() constructor, is far far far larger than the time needed to download the stream.
When I surfed some blogs to search about this issue, I found that some developers were using the Image.FromStream() method which has a validateImageData flag that seems to control some validation code. When validateImageData is false, the conversion gets dramatically faster.
Good, I thought …. but the Compact Framework does not implement this method !
Anyone knows how to get around it, or at least how to convert a stream into an Image without unnecessary delays ?
Not sure if this will help but OpenNETCF.Drawing.Imaging has classes to read images from streams, but they are IImage wrapped com objects. You can then use IImage.Draw to draw it onto your bitmap. It also has a GetThumbnail method that I use to get a scaled image of large jpegs on the device.
Here is a blog post about it from Alex Feinman.