Тёмный

Images in CustomTkinter - Tkinter CustomTkinter 17 

Tkinter․com
Подписаться 100 тыс.
Просмотров 13 тыс.
50% 1

Опубликовано:

 

30 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии    
@TkinterPython
@TkinterPython 11 месяцев назад
▶ Watch CustomTkinter Playlist ✅ FREE Tkinter Widget Book bit.ly/45iO4OP bit.ly/3K4qlZC ▶ See More At: ✅ Subscribe To My RU-vid Channel: Tkinter.com bit.ly/3Pk1By4 ▶ MASSIVE TKINTER.COM DISCOUNT ✅ Join My Facebook Group: 30% off with coupon code: youtube bit.ly/2GFmOBz ▶ Get The Code For This Video bit.ly/3dCzz2K
@AlexandreVillares
@AlexandreVillares 10 месяцев назад
Great vídeo, as usual! I was wondering, the reason to have a dark image might be so you can have two different versions of the image that go best with each mode (like different logo versions, or diagram versions).
@TkinterPython
@TkinterPython 10 месяцев назад
could be!@@AlexandreVillares
@Claude_CJ_Vercetti
@Claude_CJ_Vercetti 10 месяцев назад
Thanks a lot!
@Codemycom
@Codemycom 10 месяцев назад
Welcome!
@laraynacho
@laraynacho 10 месяцев назад
Could you help me with the following error? in line 17 AttributeError: type object 'Image' has no attribute 'open' thanks
@TkinterPython
@TkinterPython 10 месяцев назад
You didn't pip install pillow or import it at the top of the code.
@PAMMUPERSENAL
@PAMMUPERSENAL 5 месяцев назад
@@TkinterPythonstill not working
@Codemycom
@Codemycom 5 месяцев назад
@@PAMMUPERSENAL did you import Image?
@omerarslan7814
@omerarslan7814 5 месяцев назад
@@PAMMUPERSENAL from PIL Import image
@Arkaitz.M.A
@Arkaitz.M.A 7 месяцев назад
When I enter my_image configured as you say, the image does not open in either light mode or dark mode, however, when I enter it in the label it does appear. I´m using python 3.12.2 , pillow 10.2.0, and VsCode
@TkinterPython
@TkinterPython 7 месяцев назад
Hm, weird...no typos?
@Arkaitz.M.A
@Arkaitz.M.A 7 месяцев назад
@@TkinterPython import customtkinter from PIL import Image customtkinter.set_appearance_mode('dark') customtkinter.set_default_color_theme("dark-blue") root=customtkinter.CTk() root.title('Nirvana') root.iconbitmap("C:/Users/arkai/Desktop/Python/11-Interfaces/2-Custom_Tkinter/Nirvana.ico") root.geometry('800x500') my_image=ctk.CTkImage(light_image=Image.open('nirvana.png')) root.mainloop() I have it exactly the same. The root window opens but does not show anything, however, when I complete the code with the resizing and the label, then it works correctly. The terminal path is exactly where both the file and the image are. It's very strange
@Arkaitz.M.A
@Arkaitz.M.A 7 месяцев назад
I have it exactly the same. The path of the terminal is set in the folder where both the python file and the image are located. When you run the program, root opens, but it does not show any image. However, when I complete the video code with the label, the image appears wonderfully well. Is very strange This works great: import customtkinter as ctk from PIL import Image ctk.set_appearance_mode('dark') ctk.set_default_color_theme("dark-blue") root=ctk.CTk() root.title('Nirvana') root.iconbitmap("Nirvana.ico") root.geometry('800x500') my_image=ctk.CTkImage(light_image=Image.open('nirvana.png'), dark_image=Image.open('nirvana.png'),size=(520,380)) my_label=ctk.CTkLabel(root,text='',image=my_image) my_label.pack(pady=10) root.mainloop() This other one doesn't work: import customtkinter as ctk from PIL import Image ctk.set_appearance_mode('dark') ctk.set_default_color_theme("dark-blue") root=ctk.CTk() root.title('Nirvana') root.iconbitmap("Nirvana.ico") root.geometry('800x500') my_image=ctk.CTkImage(light_image=Image.open('nirvana.png')) root.mainloop() ​@@TkinterPython
@Arkaitz.M.A
@Arkaitz.M.A 3 месяца назад
Is there any possibility to play a video in the customTkinter label, just as it is done in tkinter. The images would come from the acquisition of frames in opencv. cap=cv2.VideoCapture(0,cv2.CAP_DSHOW) def visualize(): global cap ret, frame = cap.read() if ret: frame=imutils.resize(frame,width=350) frame=cv2.flip(frame,1) frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) im = Image.fromarray(frame) img = ImageTk.PhotoImage(image=im) lblVideo.configure(image=img) lblVideo.image = img lblVideo.after(10, visualize)
@wilsawndideh6315
@wilsawndideh6315 5 месяцев назад
Hello, is there a way to display an icon next to the title of a customtkinter window?
@Codemycom
@Codemycom 5 месяцев назад
yes, in the way that we did it in this video...
@rogerjames9392
@rogerjames9392 6 часов назад
Just found this video of yours, and it is very helpful, only problem is in the resizing it does not keep the aspect ratio, I created this shorty that may just help anyone else needing to do this.. img = f"./pix/origpicture.png" # path to pic im = Image.open(img) nw = 640 # enter your new width nh = int(nw/im.width * im.height) # calculates your new height my_image = ct.CTkImage(dark_image=Image.open(img), size=(nw, nh)) # creates new image my_label = ct.CTkLabel(window, text = "", image = my_image) my_label.grid(column = 0, row = 0) Again thank you for all your videos, I have been learning from you for years !!
@ricardoarcesiovillanueva1723
@ricardoarcesiovillanueva1723 10 месяцев назад
It is impossible for me to put a background image and a label on top of it, it always comes out with the square of the label, even if it is transparent it still leaves a gap with the shape of the label on top of the image, and they are not assimilated to the floating text.
@samiksha2273
@samiksha2273 7 месяцев назад
Hey did you get any answer for this? Am suffering from the same problem
@viniciuspalmeira3246
@viniciuspalmeira3246 5 месяцев назад
@@samiksha2273 bro maybe it doesn't even have it, because there are things in python that haven't even been updated in a century
@joaocamilo2521
@joaocamilo2521 4 месяца назад
How to display a Base64 encoded image?
@ZeroCool22
@ZeroCool22 7 месяцев назад
_tkinter.TclError: image "pyimage4" doesn't exist
@TkinterPython
@TkinterPython 7 месяцев назад
Google it
@spaceillusion160
@spaceillusion160 11 месяцев назад
Nobody can build project with CustomTkinter in single-file executable file, .exe, and it sucks
@TkinterPython
@TkinterPython 11 месяцев назад
What a strange thing to say: customtkinter.tomschimansky.com/documentation/packaging
@АндрейТитов-ж7л
@АндрейТитов-ж7л 11 месяцев назад
I did it recently :)
@TkinterPython
@TkinterPython 11 месяцев назад
@@АндрейТитов-ж7л Yep, it's totally possible, and pretty straight forward.
@RoshiAILol
@RoshiAILol 3 месяца назад
So ummm there is no attribute called .open in Image
@mongoose1804
@mongoose1804 2 месяца назад
WRONG
@jenilchudgar
@jenilchudgar 11 месяцев назад
First ❤, Can you pin? 🎉
@jenilchudgar
@jenilchudgar 11 месяцев назад
I'm 13 btw
@TkinterPython
@TkinterPython 11 месяцев назад
nice!@@jenilchudgar
@Burkert-t3p
@Burkert-t3p 9 месяцев назад
I get this error message Traceback (most recent call last): File "/home/david/PythonCodes/Energieffizienzklassenrechner3.py", line 7, in from PIL import Image, ImageTk File "/home/david/PythonCodes/PIL/Image.py", line 84, in from . import _imaging as core ImportError: cannot import name '_imaging' from 'PIL' (/home/david/PythonCodes/PIL/__init__.py) [Finished in 102ms with exit code 1] [cmd: ['python3', '-u', '/home/david/PythonCodes/Energieffizienzklassenrechner3.py']] [dir: /home/david/PythonCodes] [path: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin] Could you help me ?
@TkinterPython
@TkinterPython 9 месяцев назад
Did you pip install Pillow?
Далее
Option Menu - Tkinter CustomTkinter 18
15:31
Просмотров 11 тыс.
Svelte 5's Secret Weapon: Classes + Context
18:14
Просмотров 24 тыс.
JUJU HAS IT ALL! | Brawl Stars Animation
00:53
Просмотров 4 млн
Adding Images To Your Apps - Intro To Tkinter 5
10:15
Просмотров 1,6 тыс.
I Made 200 Python Projects...Here Are My 5 FAVORITES
11:23
Next.js 15 Breakdown (Everything You Need To Know)
18:10
Modern Graphical User Interfaces in Python
11:12
Просмотров 1,6 млн
Entry Boxes for Text - Intro To Tkinter 2
14:31
Просмотров 1,4 тыс.