How do I get a C# WebBrowser control to show jpeg files (raw)?

You have to implement an async pluggable protocol, e.g. IClassFactory, IInternetProtocol… Then you use CoInternetGetSession to register your protocol. When IE calls your implementation, you can serve your image data from memory/provide mime type.

It’s a bit tedious, but doable. Look at IInternetProtocol and pluggable protocols documentation on MSDN.

Leave a Comment