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.ActionThe
ScreenshotActionis able to save a screenshot of the contents ofCanvasPanelandPlotPanelviews.-
__init__(overlayList, displayCtx, panel)[source]¶ Create a
ScreenshotAction.- Parameters
overlayList – The
OverlayList.displayCtx – The
DisplayContext.panel – The
CanvasPanelorPlotPanelto take a screenshot of.PlotCanvasinstances 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.
-
__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
PlotPanelorPlotPanel, saving it to the givenfilename.
-
fsleyes.actions.screenshot.canvasPanelScreenshot(panel, filename)[source]¶ Capture a screenshot of the contents of the given
CanvasPanelorPlotPanel, 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.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.