imagepanel
Based on ChartPanelBase, a canvas for displaying an image within a wxPython window using PIL and matplotlib, with a right click menu with some basic options
Classes:
|
Custom Event for an image in the ImagePanel being changed. |
|
Panel that contains a matplotlib plotting window, used for displaying an image. |
-
class
EvtImgPanelChanged
(windowID, obj)[source] Bases:
PyCommandEvent
Custom Event for an image in the ImagePanel being changed.
- Parameters
windowID (
int
)obj
Attributes:
-
class
ImagePanel
(parent, image=None, id=- 1, pos=(- 1, - 1), size=(- 1, - 1), style=0, name=b'panel')[source] Bases:
ChartPanelBase
Panel that contains a matplotlib plotting window, used for displaying an image. The image can be right clicked to bring up a context menu allowing copying, pasting and saving of the image. The image can be panned by holding the left mouse button and moving the mouse, and zoomed in and out using the scrollwheel on the mouse.
- Parameters
parent (
Window
) – The parent window.image – Default
None
.id (
int
) – An identifier for the panel. wx.ID_ANY is taken to mean a default. Default-1
.pos (
Point
) – The panel position. The valuewx.DefaultPosition
indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform. Default(-1, -1)
.size (
Size
) – The panel size. The value ::wxDefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform. Default(-1, -1)
.style (
int
) – The window style. See wxPanel. Default0
.name (
str
) – Window name. Defaultb'panel'
.
Methods:
clear
([event])Clear the image from the control
copy
([_])Copy the image to the clipboard.
load_image
([new_image, suppress_event])Load the ‘new_image’ into the control.
on_context_menu
(event)Event Handler for bringing up right click context menu
on_load
([event])Load the image into the dialog from the file selected in the dialog
on_save
([event])Save the image to the location selected in the dialog
paste
([event])Paste the image from the clipboard into the control.
reset_view
(*_)Reset the view of the image.
Attributes:
Returns the image being displayed in the control
-
property
image
Returns the image being displayed in the control
- Return type
Event Handler for bringing up right click context menu