I begun to develope in C#, and I'm trying to convert a surface to a byte buffer or to a Picture (to convert after to a byte buffer too).
I saw in other question this code:
string fileName = Path.GetTempFileName();
webView2.Render().SaveToPng(fileName);
byte[] bytes = File.ReadAllBytes(fileName);
File.Delete(fileName);
MemoryStream ms = new MemoryStream(bytes);
But, a webview don't have Render(), and he don't say what libraries I need to import.
I stop here:
var view = (WebView)WebCore.Views.Last();
WebCore.Update();
BitmapSurface surface = (BitmapSurface)view.Surface;
surface.??
There have been many undocumented changes in Awesomium lately.
Try
WebView.Surface
instead ofWebView.Render
.There have been another set of changes that were pointed out in the comments. Just for the sake of correctness, here is an updated code and a link to the documentation.
Source: http://docs.awesomium.net/html/b2fc3fe8-72bd-4baf-980f-b9b9456d5ca4.htm
You mean something like this?
What about the Buffer method? That should be what you want.