Here is how I make awesomium screenshot:
webView2.Render().SaveToPng("filePath");
The problem is that I now need not to save bytes to file but get them inmemory. How can I achieve that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The documentation states that Render() returns an instance of RenderBuffer, which has a property called Buffer, that returns the raw pixel data (as an IntPtr).
If you still need a byte array, you could use Marshal.Copy to copy the data into a byte array. This way, you can do it without the need of a temporary file.