🎉 | Added icon and option to launch windowed.
This commit is contained in:
11
ResourceManager.py
Normal file
11
ResourceManager.py
Normal file
@ -0,0 +1,11 @@
|
||||
from PIL import ImageTk, Image
|
||||
import os
|
||||
import sys
|
||||
|
||||
def resource_path(relative_path):
|
||||
base_path = getattr(sys, '_MEIPASS', os.path.dirname(os.path.abspath(__file__)))
|
||||
return os.path.join(base_path, relative_path)
|
||||
|
||||
def get_image_and_resize(path_to_image, width, height):
|
||||
image = Image.open(resource_path(path_to_image)).resize((width, height))
|
||||
return ImageTk.PhotoImage(image)
|
Reference in New Issue
Block a user