Does anyone know in .Net 2.0 -.Net 3.5 how to load jpeg into System.Windows.Forms.WebControl as a byte array and with the correct mimetypes parameters so that it displays?
Sort of:
webBrowser1.DocumentStream = new MemoryStream(File.ReadAllBytes("mypic.jpg")); webBrowser1.DocumentType = "application/jpeg";
WebBrowser1.DocumentType seems to be read-only, so I don't know how to do this. In general, I want to be able to download any type of file using the mimetype defined in the browser to show it.
Solutions with temporary file files for writing are not good. I currently solved it with a small local web server socket listener that provides the jpeg I'm requesting with the correct mimetype type.
UPDATE: since someone deleted the question with my answer in which I had information that others could use, I will add it as an update. (for those who remove this path, please update the questions with important information).
An example solution in C # works fine here: http://www.codeproject.com/KB/aspnet/AspxProtocol.aspx
Wolf5 source share