问题
I would need to display certain images and text in c# WinForms application, so I decided to use WebBrowser. Both images and text are retrieved from the database. However, I don't know how to combine them in the document creation. Thank you!
回答1:
Besides nobugz's suggestion, you can implement IMoniker on an object that exposes your data as mht (web archive) and use IE document's IPersistMoniker interface to load from your object. http://www.codeproject.com/KB/miscctrl/csEXWB.aspx is an example for this interface. The benefit of using IMoniker over IStream is that you can specify a base URL for your document.
来源:https://stackoverflow.com/questions/1797469/building-a-document-with-text-and-images-from-streams