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:
Capture a screenshot of the contents of the given |
|
Capture a screenshot of the contents of the given |
|
Capture a screenshot of the contents of the given |
- class fsleyes.actions.screenshot.ScreenshotAction(overlayList, displayCtx, panel)[source]¶
Bases:
fsleyes.actions.base.Action
The
ScreenshotAction
is able to save a screenshot of the contents ofCanvasPanel
andPlotPanel
views.- __init__(overlayList, displayCtx, panel)[source]¶
Create a
ScreenshotAction
.- Parameters
overlayList – The
OverlayList
.displayCtx – The
DisplayContext
.panel – The
CanvasPanel
orPlotPanel
to take a screenshot of.PlotCanvas
instances are also accepted.
- __doScreenshot()¶
Capture a screenshot. Prompts the user to select a file to save the screenshot to, and then calls the
screenshot()
function.
- __annotations__ = {}¶
- __module__ = 'fsleyes.actions.screenshot'¶
- fsleyes.actions.screenshot.screenshot(panel, filename)[source]¶
Capture a screenshot of the contents of the given
CanvasPanel
,PlotPanel
, orPlotCanvas
, saving it to the givenfilename
.
- fsleyes.actions.screenshot.plotPanelScreenshot(panel, filename)[source]¶
Capture a screenshot of the contents of the given
PlotPanel
orPlotPanel
, saving it to the givenfilename
.
- fsleyes.actions.screenshot.canvasPanelScreenshot(panel, filename)[source]¶
Capture a screenshot of the contents of the given
CanvasPanel
orPlotPanel
, saving it to the givenfilename
.
- fsleyes.actions.screenshot._patchInCanvases(canvasPanel, containerPanel, data, bgColour)[source]¶
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.