Skip to content

Commit

Permalink
bonne icone
Browse files Browse the repository at this point in the history
  • Loading branch information
Paullux committed Mar 11, 2023
1 parent 2d2035a commit 2181483
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Matrix.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ block_cipher = None
a = Analysis(
['ascii12.py'],
pathex=[],
binaries=[],
datas=[('.\icon-32.png', '.\icon-32.png')],
binaries=[('I:\\ascii\\matrix.ico', '.')],
datas=[('I:\\ascii\\matrix.ico', '.')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
Expand Down Expand Up @@ -52,5 +52,5 @@ exe = EXE(
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['icon-32.png'],
icon=['I:\\ascii\\matrix.ico'],
)
18 changes: 15 additions & 3 deletions ascii12.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
camera = 1 # à Modifier si ne fonctionne pas

#add id to app to show icon in window and taskbar
myappid = 'bit-scripts.matrix.cameraascii.twelve' # arbitrary string
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
#myappid = 'bit-scripts.matrix.cameraascii.twelve' # arbitrary string
#ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)

# Variable partagée pour signaler à un thread qu'il doit s'arrêter
stop = threading.Event()
Expand All @@ -44,6 +44,17 @@ def image_to_ascii(image):
ascii_image += "\n"
return ascii_image


def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")

return os.path.join(base_path, relative_path)

# Création de la fenêtre tkinter
root = tk.Tk()
root.configure(bg='#000')
Expand All @@ -53,7 +64,8 @@ def image_to_ascii(image):
sh = root.winfo_screenheight()
root.geometry("%dx%d+%d+%d" % (1100, 620, (sw-1100)/2, (sh-620)/2))
directory = os.getcwd()
root.tk.call('wm','iconphoto',root._w,tk.PhotoImage(file=directory + "/icon-32.png"))
#root.tk.call('wm','iconphoto',root._w,tk.PhotoImage(file=directory + "/icon-32.png"))
root.iconbitmap(resource_path('matrix.ico'))
root.title("ASCII Camera")
if getattr(sys, 'frozen', False):
import pyi_splash
Expand Down
Binary file added ico/Matrix.ico
Binary file not shown.
Binary file added matrix.ico
Binary file not shown.
Binary file removed output/Matrix.exe
Binary file not shown.
Binary file removed output/icon-32.ico
Binary file not shown.
Binary file removed output/icon-32.png
Binary file not shown.

0 comments on commit 2181483

Please sign in to comment.