fsleyes_widgets.imagepanel
¶
This module provides the ImagePanel
class, for displaying a
wx.Image
.
-
class
fsleyes_widgets.imagepanel.
ImagePanel
(parent, image=None, preserveAspect=False)¶ Bases:
wx._core.Panel
A
wx.Panel
which may be used to display a resizeablewx.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 theSetImage()
method.Parameters: - parent – The
wx
parent object. - image – The
wx.Image
object to display. - preserveAspect – Defaults to
False
. IfTrue
, the image aspect ratio is preserved.
-
__init__
(parent, image=None, preserveAspect=False)¶ Create an
ImagePanel
.If the
image
is not passed in here, it can be set later with theSetImage()
method.Parameters: - parent – The
wx
parent object. - image – The
wx.Image
object to display. - preserveAspect – Defaults to
False
. IfTrue
, the image aspect ratio is preserved.
- parent – The
-
SetImage
(image)¶ Set the image that is displayed on this
ImagePanel
.Parameters: image – The wx.Image
object to display.
-
Draw
(ev=None)¶ Draws this
ImagePanel
. The image is scaled to the current panel size.
-
_ImagePanel__onSize
(ev)¶ Redraw this panel when it is sized, so the image is scaled appropriately - see the
Draw()
method.
-
__module__
= 'fsleyes_widgets.imagepanel'¶
- parent – The