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.ActionThe
ScreenshotActionis able to save a screenshot of the contents ofCanvasPanelandPlotPanelviews.-
__init__(overlayList, displayCtx, panel)¶ Create a
ScreenshotAction.Parameters: - overlayList – The
OverlayList. - displayCtx – The
DisplayContext. - panel – The
CanvasPanelorPlotPanelto 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
CanvasPanelorPlotPanel, saving it to the givenfilename.
-
fsleyes.actions.screenshot.plotPanelScreenshot(panel, filename)¶ Capture a screenshot of the contents of the given
PlotPanelorPlotPanel, saving it to the givenfilename.
-
fsleyes.actions.screenshot.canvasPanelScreenshot(panel, filename)¶ Capture a screenshot of the contents of the given
CanvasPanelorPlotPanel, 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.GLCanvasinstances are not captured by theWindowDC/MemoryDCblitting process performed by thecanvasPanelScreenshotfunction - they come out all black.So this function manually patches in bitmaps (read from the GL front buffer) of each
GLCanvasthat is displayed in the canvas panel.