GUIBRUSHR.GUI.WIDGET.MyImage module¶
- class GUIBRUSHR.GUI.WIDGET.MyImage.MyImage(parent: Any, row: int, column: int, width: int, height: int, path_image: str, columnspan: int = 2, rowspan: int = 1, label: bool = False, **kwargs)[source]¶
Bases:
FrameA custom image widget that displays images in a Frame.
This class creates an image display widget that can show images either using a Label or a Canvas widget, depending on the configuration. The image is automatically resized to fit the specified dimensions.
- width¶
Width of the image display area
- Type:
int
- height¶
Height of the image display area
- Type:
int
- image¶
The tkinter PhotoImage object
- Type:
PhotoImage
- canvas¶
The Canvas widget if label=False
- Type:
Optional[Canvas]
- __init__(parent: Any, row: int, column: int, width: int, height: int, path_image: str, columnspan: int = 2, rowspan: int = 1, label: bool = False, **kwargs) None[source]¶
Initialize the MyImage widget.
- Parameters:
parent – The parent widget
row – Row position in the parent’s grid
column – Column position in the parent’s grid
width – Width of the image display area
height – Height of the image display area
path_image – Path to the image file to display
columnspan – Number of columns the widget should span
rowspan – Number of rows the widget should span
label – If True, use Label widget; if False, use Canvas widget
**kwargs – Additional keyword arguments passed to the Frame widget