Open veqryn opened 6 years ago
Hi, In my case, I did this :
window, err := gtk.OffscreenWindowNew()
webView.SetSizeRequest(1920, 1080);
window.Add(webView)
// remaining code
The resulting image has width=1908, that can be explained by scrollbars appearing on the website I am viewing. To view the windows, you can "screenshot" it :
surface, err := window.GetSurface()
surface.WriteToPNG("/tmp/window.png")
I am trying to take a snapshot of a WebView, but all my snapshots comes out at 320x5068. I would like to take a snapshot at 800x800, or at least a width of 800 pixels and I can crop it myself later.
I've tried SetSizeRequest and SetAllocation on the WebView. I've tried putting the WebView into a Window that has been SetDefaultSize and SetResizable=false.
Nothing seems to work. Please help me?