fsleyes_widgets.imagepanel

This module provides the ImagePanel class, for displaying a wx.Image.

class fsleyes_widgets.imagepanel.ImagePanel(parent, image=None, preserveAspect=False)[source]

Bases: Panel

A wx.Panel which may be used to display a resizeable wx.Image. The image is scaled to the size of the panel.

Create an ImagePanel.

If the image is not passed in here, it can be set later with the SetImage() method.

Parameters:
  • parent – The wx parent object.

  • image – The wx.Image object to display.

  • preserveAspect – Defaults to False. If True, the image aspect ratio is preserved.

SetImage(image)[source]

Set the image that is displayed on this ImagePanel.

Parameters:

image – The wx.Image object to display.

Draw(ev=None)[source]

Draws this ImagePanel. The image is scaled to the current panel size.