Skip to content

Commit 2181483

Browse files
committed
bonne icone
1 parent 2d2035a commit 2181483

File tree

7 files changed

+18
-6
lines changed

7 files changed

+18
-6
lines changed

Matrix.spec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ block_cipher = None
77
a = Analysis(
88
['ascii12.py'],
99
pathex=[],
10-
binaries=[],
11-
datas=[('.\icon-32.png', '.\icon-32.png')],
10+
binaries=[('I:\\ascii\\matrix.ico', '.')],
11+
datas=[('I:\\ascii\\matrix.ico', '.')],
1212
hiddenimports=[],
1313
hookspath=[],
1414
hooksconfig={},
@@ -52,5 +52,5 @@ exe = EXE(
5252
target_arch=None,
5353
codesign_identity=None,
5454
entitlements_file=None,
55-
icon=['icon-32.png'],
55+
icon=['I:\\ascii\\matrix.ico'],
5656
)

ascii12.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
camera = 1 # à Modifier si ne fonctionne pas
2121

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

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

47+
48+
def resource_path(relative_path):
49+
""" Get absolute path to resource, works for dev and for PyInstaller """
50+
try:
51+
# PyInstaller creates a temp folder and stores path in _MEIPASS
52+
base_path = sys._MEIPASS
53+
except Exception:
54+
base_path = os.path.abspath(".")
55+
56+
return os.path.join(base_path, relative_path)
57+
4758
# Création de la fenêtre tkinter
4859
root = tk.Tk()
4960
root.configure(bg='#000')
@@ -53,7 +64,8 @@ def image_to_ascii(image):
5364
sh = root.winfo_screenheight()
5465
root.geometry("%dx%d+%d+%d" % (1100, 620, (sw-1100)/2, (sh-620)/2))
5566
directory = os.getcwd()
56-
root.tk.call('wm','iconphoto',root._w,tk.PhotoImage(file=directory + "/icon-32.png"))
67+
#root.tk.call('wm','iconphoto',root._w,tk.PhotoImage(file=directory + "/icon-32.png"))
68+
root.iconbitmap(resource_path('matrix.ico'))
5769
root.title("ASCII Camera")
5870
if getattr(sys, 'frozen', False):
5971
import pyi_splash

ico/Matrix.ico

187 KB
Binary file not shown.

matrix.ico

187 KB
Binary file not shown.

output/Matrix.exe

-69.9 MB
Binary file not shown.

output/icon-32.ico

-4.19 KB
Binary file not shown.

output/icon-32.png

-966 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)