Python GUI Tutorial - 16 - Canvas - create image  | Tkinter

Python GUI Tutorial - 16 - Canvas - create image | Tkinter

Tech-Gram Academy

5 лет назад

59,609 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@autarroy
@autarroy - 26.04.2023 08:19

I have a question
Can I

Ответить
@laceymcgee85
@laceymcgee85 - 13.04.2022 22:23

is there anyway to add two images at the same time

Ответить
@drprofessor4176
@drprofessor4176 - 11.09.2021 19:06

It is showing error permission denied what should i do

Ответить
@wakkendul1434
@wakkendul1434 - 27.06.2021 12:17

bro how to save that image with canvas

Ответить
@Firstname-ei9il
@Firstname-ei9il - 08.04.2021 19:44

How to add text beside the image because when I tired doing that it disappeared behind the canvas

Ответить
@welidbenchouche
@welidbenchouche - 27.03.2021 12:27

amazing video, now how can i export the result as png or eps?

Ответить
@kavyadiwan8646
@kavyadiwan8646 - 23.03.2021 07:53

TCL ERROR FILE

Ответить
@manojkumarmahalik6206
@manojkumarmahalik6206 - 05.02.2021 05:30

My selected image is bigger than the canvas size. Dear sir please tell me how how to show full image inside this canvas.

Ответить
@zainulkhan8381
@zainulkhan8381 - 04.12.2020 08:22

You can use jpg image too by importing pillow

Ответить
@shivnandan5924
@shivnandan5924 - 13.10.2020 14:45

You are the best teacher in the whole world 😃👌👌👍

Ответить
@1979zeesh
@1979zeesh - 06.10.2020 17:37

hi ive been following your tutorials alot and they help me so much.i am stuck at an issue: i want to play a video mp4 format file inside this canvas instead of showing image file. can u help

Ответить
@petrockspiracy3120
@petrockspiracy3120 - 10.09.2020 16:17

I literally copy the code and it just creates a blank window, using a png file. I don't get it.

Ответить
@computerbrand9701
@computerbrand9701 - 02.09.2020 21:18

Sir i wanna fit the image within the frame i created the image resolution is 1920x1080 but i want it to auto adjust to the size of the frame. Can i do that?

Ответить
@varungaur9690
@varungaur9690 - 02.07.2020 15:58

Thank you very much. Keep making these videos

Ответить
@-ankitaprajapati-9819
@-ankitaprajapati-9819 - 27.06.2020 18:36

Tonny stark// ironman

Ответить
@jaiyadav5789
@jaiyadav5789 - 23.04.2020 07:56

image couldn't open in my program ... as it says _tkinter.TclError: couldn't open 'c://users//Jai yadav// Pictures//screenshot'): no such file or directory

Ответить
@VIKASHKUMAR-ql2it
@VIKASHKUMAR-ql2it - 20.04.2020 13:58

sir text widget ma pic kaisa add kra

Ответить
@user-yu3bm8wm4v
@user-yu3bm8wm4v - 20.04.2020 06:32

Thanks!

Ответить
@peaceout1825
@peaceout1825 - 03.04.2020 19:36

and i want you desktop background

Ответить
@peaceout1825
@peaceout1825 - 03.04.2020 19:35

very nice video
thanks a lot

Ответить
@atalyy
@atalyy - 31.03.2020 03:12

change the title, you're not talking in english, disliked

Ответить
@sukhmeetsingh7589
@sukhmeetsingh7589 - 14.03.2020 16:04

Sir how we can add simply text on the background image and change text properties

Ответить
@rockingsharath2880
@rockingsharath2880 - 07.03.2020 19:43

How to add image in second window

Ответить
@rajpant8044
@rajpant8044 - 18.11.2019 09:12

Hii I'm trying to insert an image in my windows pc, using pycharm but an error is coming every time, it states
Unicode error,

Ответить
@namratakhandagale2610
@namratakhandagale2610 - 08.11.2019 19:09

Hi sir I'M not getting the image on tkinter window it is giving error

Ответить
@chandraveersingh1515
@chandraveersingh1515 - 16.09.2019 10:14

Thank you sir

Ответить
@donnadietz
@donnadietz - 25.08.2019 00:11

English speaker here... totally understandable video! Thanks!

Ответить
@mohammadanarul624
@mohammadanarul624 - 09.07.2019 22:21

thank you so much

Ответить
@ratanpriya4148
@ratanpriya4148 - 05.07.2019 08:09

sir my image not show

Ответить
@dontblinkmen
@dontblinkmen - 07.06.2019 15:22

hey it's code 100% work cheak now


from tkinter import *
from PIL import Image, ImageTk


win = Tk()
win.title("Nsfuntu s")

canvas= Canvas(width =400, height= 200, bg="red")
canvas.pack()
image = Image.open("images (1).jpg")
photo = ImageTk.PhotoImage(image)
canvas.create_image(0, 0, image = photo ,anchor= NW)


win.mainloop()

Ответить
@dontblinkmen
@dontblinkmen - 07.06.2019 12:29

bro // ki jagh per small r use kiya karo is se path le lega ex = file=r"file path " like this

Ответить
@namanshukla8641
@namanshukla8641 - 25.05.2019 00:04

Sir image ka size canvas se bada hone par wo fit nhi hoti hai. Please solution bataye ki image ko Canvas me fit kaise kare

Ответить
@SuplexCityF5
@SuplexCityF5 - 22.05.2019 07:24

Windows users have backward slash in location path compared to Mac which have forward slash. So how to insert the image by copying the location? I'm getting error. Tried everything

Ответить
@rishabhagrawal5555
@rishabhagrawal5555 - 17.05.2019 12:05

there is an error '''image "pyimage3" doesn't exist''''

Ответить
@celdorufus2560
@celdorufus2560 - 01.05.2019 17:11

it's showing an error that :name 'canvas' is not defined

Ответить
@meetpatel1232
@meetpatel1232 - 01.01.2019 10:07

```
from tkinter import *

root = Tk()

canvas = Canvas(root, width=200,height=200)
canvas.pack()

photo = PhotoImage(file='C:\\Users\\Maten57\\Pictures\\SpotBright\\aaa.jpg')
canvas.crete_image(0,0, image=photo , anchor=NW)

root.minsize(300,300)
root.mainloop()
```

Ответить
@ankitkumarchaudhary7108
@ankitkumarchaudhary7108 - 13.11.2018 11:32

Sir ek problem h..is gui ko portable kese bnay..Image address different rhega...for every pc & lapi

Ответить
@SachinKumar-lp8ds
@SachinKumar-lp8ds - 01.11.2018 01:48

How can i connect canvas image with button means when i will click on button then the image will shown,

Ответить
@gauravphalke7302
@gauravphalke7302 - 21.10.2018 15:33

Hey can anyone tell me how to resize image

Ответить
@AkashSingh-gy9wl
@AkashSingh-gy9wl - 30.09.2018 11:15

It is showing error

# Image in canvas

import tkinter as tk
root = tk.Tk()

can = tk.Canvas(root, width = 400, height = 500, bg = 'yellow')
can.pack()

photo = PhotoImage(file = "Nature.png")

can.create_image(0,0, image = photo, anchor = NW)

root.mainloop()



error

name 'PhotoImage' is not defined

Ответить