Mega Code Archive

 
Categories / Delphi / Examples
 

Streamtowebbrowser

I answered your question on delphipages.com // This writes a MemoryStream to the WebBrowser document // without using any disk access procedure TForm1.Button1Click(Sender: TObject); var M:TMemoryStream; doc:variant; S:string; begin M:=TMemoryStream.Create; try // I used a Memo to add data to the Stream. Memo1.Lines.SaveToStream(M); M.position:=0; SetLength(S, M.Size); M.Read(S[1],M.Size); // You must have a document loded in the // WebBrowser, if you don't, just navigate // to the blank page like this: WebBrowser1.Navigate('about:blank'); doc:=WebBrowser1.Document; doc.Write(S); finally M.Free; end; end;