fsleyes.actions.screenshot
¶
This module provides the ScreenshotAction
class, an
Action
which can take screenshots of CanvasPanel
and
PlotPanel
views.
A few stand-alone functions are defined in this module:
screenshot |
Capture a screenshot of the contents of the given CanvasPanel or PlotPanel , saving it to the given filename . |
plotPanelScreenshot |
Capture a screenshot of the contents of the given PlotPanel or PlotPanel , saving it to the given filename . |
canvasPanelScreenshot |
Capture a screenshot of the contents of the given CanvasPanel or PlotPanel , saving it to the given filename . |
-
class
fsleyes.actions.screenshot.
ScreenshotAction
(overlayList, displayCtx, panel)¶ Bases:
fsleyes.actions.base.Action
The
ScreenshotAction
is able to save a screenshot of the contents ofCanvasPanel
andPlotPanel
views.-
__init__
(overlayList, displayCtx, panel)¶ Create a
ScreenshotAction
.Parameters: - overlayList – The
OverlayList
. - displayCtx – The
DisplayContext
. - panel – The
CanvasPanel
orPlotPanel
to take a screenshot of.
- overlayList – The
-
_ScreenshotAction__doScreenshot
()¶ Capture a screenshot. Prompts the user to select a file to save the screenshot to, and then calls the
screenshot()
function.
-
__module__
= 'fsleyes.actions.screenshot'¶
-
-
fsleyes.actions.screenshot.
screenshot
(panel, filename)¶ Capture a screenshot of the contents of the given
CanvasPanel
orPlotPanel
, saving it to the givenfilename
.
-
fsleyes.actions.screenshot.
plotPanelScreenshot
(panel, filename)¶ Capture a screenshot of the contents of the given
PlotPanel
orPlotPanel
, saving it to the givenfilename
.
-
fsleyes.actions.screenshot.
canvasPanelScreenshot
(panel, filename)¶ Capture a screenshot of the contents of the given
CanvasPanel
orPlotPanel
, saving it to the givenfilename
.
-
fsleyes.actions.screenshot.
_patchInCanvases
(canvasPanel, containerPanel, data, bgColour)¶ Used by the
canvasPanelScreenshot()
function.For some unknown reason, under OSX and when running over X11/SSH, the contents of
wx.glcanvas.GLCanvas
instances are not captured by theWindowDC
/MemoryDC
blitting process performed by thecanvasPanelScreenshot
function - they come out all black.So this function manually patches in bitmaps (read from the GL front buffer) of each
GLCanvas
that is displayed in the canvas panel.