You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and two of its callbacks: [OnLoadingStateChange](../api/LoadHandler.md#onloadingstatechange)
589
+
and [OnLoadError](../api/LoadHandler.md#onloaderror). The
590
+
OnLoadingStateChange callbacks notifies when web page loading
591
+
completes and OnLoadError callback notifies if loading of
592
+
page failed. When loading succeeds a function save_screenshot()
593
+
is called which retrieves image buffer that was earlier stored
594
+
in the browser object and then uses PIL image library to save
595
+
it as a PNG image.
596
+
597
+
At the end, it is worth noting that there is yet an another
598
+
option for off-screen rendering named [windowless_frame_rate](../api/BrowserSettings.md#windowless_frame_rate)
599
+
(can be passed to [CreateBrowserSync](../api/cefpython.md#createbrowsersync)),
600
+
but is not used by this example. It sets the maximum rate
601
+
in frames per second (fps) that OnPaint callback will be called
602
+
603
+
Currently CEF requires a window manager on Linux even in off-screen
604
+
rendering mode. On systems without screen or any input you can use
605
+
something like [Xvfb](https://en.wikipedia.org/wiki/Xvfb) which
606
+
performs all graphical operations in memory without showing any
607
+
screen output. Pure headless mode is currently not supported in
608
+
CEF, but that may change in the future. CEF currently depends on
609
+
X11 window manager, but there are plans to support alternative
610
+
window managers by adding Ozone support - [upstream issue #1989](https://bitbucket.org/chromiumembedded/cef/issues/1989/linux-add-ozone-support-as-an-alternative).
611
+
612
+
The screenshot.py example is just a basic showcase of off-screen
613
+
rendering features. That screenshot feature should also be possible
614
+
to implement using windowed rendering using a normal GUI window,
615
+
but a hidden one with height set to some very big value that it
616
+
wouldn't fit on screen. You could then render contents of this
617
+
window to an image. For example in Qt you can do this by using
618
+
QImage/QPainter classes along with a call to QWidget.render().
619
+
473
620
## Build executable
474
621
475
622
There are no official examples for building executable using
0 commit comments