20 lines
417 B
Python
20 lines
417 B
Python
|
|
"""
|
||
|
|
UI utility functions for Tagger GUI.
|
||
|
|
"""
|
||
|
|
from PIL import Image, ImageTk
|
||
|
|
|
||
|
|
|
||
|
|
def load_icon(path) -> ImageTk.PhotoImage:
|
||
|
|
"""
|
||
|
|
Load an icon from file and resize to 16x16.
|
||
|
|
|
||
|
|
Args:
|
||
|
|
path: Path to the image file
|
||
|
|
|
||
|
|
Returns:
|
||
|
|
ImageTk.PhotoImage resized to 16x16 pixels
|
||
|
|
"""
|
||
|
|
img = Image.open(path)
|
||
|
|
img = img.resize((16, 16), Image.Resampling.LANCZOS)
|
||
|
|
return ImageTk.PhotoImage(img)
|