![]() ![]() ![]() ![]() Path = "D:\Documents\Background.png" # Get the image full pathīackgroundLabel = Label(parent,image=img)īackgroundLabel. Self.canvas = Canvas(root,width=canvasWidth,height=canvasHeight) Img = ImageTk.PhotoImage(load) # convert the load to PhotoImage Change an image background in seconds No matter what background your photo currently has, with this template you can easily replace it with a better one. ![]() Change the background of each element with a white background to the color you. We need to handle the same situation and that is done by using the blit function when i reaches negative of the width. Save the builtin theme (both are the same) as a custom theme, with a new name. Now the cause of this happening is that i reaches negative of the width of the screen. Now use it : path = "C:/./img.png" # Get the image full path The background images displays itself twice but then returns to the back background again. Now get your full path image like: C:/./img.png When you have it use it like: from PIL import Image, ImageTk # import image so you can append the path and imagetk so you can convert it as PhotoImage If use any types of png or jpg and jpeg you can't draw it with just PhotoImage you will need PIL library pip3 install PIL Remove backgrounds 100 automatically in 5 seconds with one click Thanks to remove. To create a Label: backgroundlabel = Label(parent, image=img) Your code will not working with root.PhotoImage and root.Label. Since September 2018 development of Thonny is partially supported by Cybernetica AS. Root is your window Tk() class so you cant Attribute it for PhotoImage because it's dosen't have it so you see AttributeError tkinter.Tk() and tkinter.PhotoImage is a different classes. From 2014 to 2018 the main development of Thonny took place in Institute of Computer Science of University of Tartu, Estonia. Overrides = get_environment_overrides_for_python_subprocess(target_executable)įile "C:\Users\User\AppData\Local\Programs\Thonny\lib\site-packages\thonny\ running.py", line 1441, in get_environment_overrides_for_python_subprocessįile "C:\Users\User\AppData\Local\Programs\Thonny\.\lib\ genericpath.You are using root to Attribute PhotoImage this is impossible! Self._start_background_process(clean=clean)įile "C:\Users\User\AppData\Local\Programs\Thonny\lib\site-packages\thonny\ running.py", line 1053, in _start_background_processįile "C:\Users\User\AppData\Local\Programs\Thonny\lib\site-packages\thonny\ running.py", line 993, in _get_environmentĮnv = get_environment_for_python_subprocess(self._mgmt_executable)įile "C:\Users\User\AppData\Local\Programs\Thonny\lib\site-packages\thonny\ running.py", line 1395, in get_environment_for_python_subprocess I got that error can somebody help me ? Traceback (most recent call last):įile "C:\Users\User\AppData\Local\Programs\Thonny\lib\site-packages\thonny\ workbench.py", line 516, in _start_runnerįile "C:\Users\User\AppData\Local\Programs\Thonny\lib\site-packages\thonny\ running.py", line 118, in startįile "C:\Users\User\AppData\Local\Programs\Thonny\lib\site-packages\thonny\ running.py", line 686, in restart_backendįile "C:\Users\User\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\cpython_frontend\cp_front.py", line 36, in _init_įile "C:\Users\User\AppData\Local\Programs\Thonny\lib\site-packages\thonny\ running.py", line 950, in _init_ The background image is the basis of the game, is what makes our game more real and is where the action takes place. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |