Drag and Drop Images With The Mouse - Python Tkinter GUI Tutorial #71

Поделиться
HTML-код
  • Опубликовано: 2 ноя 2024

Комментарии • 76

  • @Codemycom
    @Codemycom  4 года назад

    ▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My RUclips Channel:
    bit.ly/2UFLKgj bit.ly/2IGzvOR
    ▶️ See More At: ✅ Join My Facebook Group:
    Codemy.com bit.ly/2GFmOBz
    ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
    Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN

  • @adityabansal4731
    @adityabansal4731 3 года назад +2

    Sir I had interest in creating games ....and I had created games in scratch but was looking for how to create them with coding ...finally found it and very easy to learn ... Appreciate your efforts ...thank you

  • @GelsYT
    @GelsYT 4 года назад +5

    love the way on how you teach things and demonstrate them in the simplest way, In that way also we can try it out own our own and do advance stuffs as long as we have an example/guide which we learned from you. Thank you :D

    • @Codemycom
      @Codemycom  4 года назад +1

      I appreciate that!

  • @luisfernandomezaflor1053
    @luisfernandomezaflor1053 3 года назад +3

    just realized Heisenberg is a good programmer too! ;D

  • @sid.mallick
    @sid.mallick 4 года назад +3

    Thanks a lot for creating this series on TKinter. This is simply super.
    Can you please make a video on how to resize images proportionately and display in TKinter?

  • @riccardozappitelli450
    @riccardozappitelli450 3 месяца назад

    5:37, thank god we've got f-strings now :D, love your content

    • @Codemycom
      @Codemycom  3 месяца назад

      they're pretty nice!

  • @swlau4161
    @swlau4161 2 года назад

    Very good explanation. Thanks for your effort for the common good!!

  • @AbunaiRei
    @AbunaiRei 2 года назад +2

    I'm trying to get the coordinates of the image because I want when the image is dropped on a certain place on the window it triggers something but I don't know how to do it

  • @ml_.oxxxxx
    @ml_.oxxxxx Год назад

    thanks for the video, i was just wondering how can i check if two different objects touch with drag and drop?

  • @anithaalex3323
    @anithaalex3323 4 года назад

    thank you so much..we appreciate your efforts

  • @thatalloguyoverthere4076
    @thatalloguyoverthere4076 4 года назад

    yes finally a tutorial that works

    • @Codemycom
      @Codemycom  4 года назад +2

      Happy you like it!

  • @jordyantoyt2453
    @jordyantoyt2453 4 года назад +5

    Please can give a tutorial playlist for pygame plz....

    • @Codemycom
      @Codemycom  4 года назад

      I may do that in the future

    • @diasybarrett3956
      @diasybarrett3956 3 года назад

      @@Codemycom Could you do a tutorial for a drag/drop game?

  • @kanhajain3028
    @kanhajain3028 3 года назад +2

    I have a doubt. I do understand using canvas.delete() method to remove images and then reprinting them on canvas, but i certainly do not understand how your method didn't created multiple copies of that image on canvas? Do clarify. Also, a wonderful series btw😁

    • @talatozmusluman
      @talatozmusluman 3 года назад +1

      Totally agree but I think multiple copies didn't created because of the image. I tried same code with rectangular, it didn't work.

    • @vladscp6579
      @vladscp6579 3 года назад +1

      I tried that with a circle,
      it seems that, for polygons, you need to remove it and then make a new one

    • @abrahamoreem2138
      @abrahamoreem2138 2 года назад

      The thing is that we are not creating new image we are redefining the previous one that's why there are not multiple copies

  • @omidghozatlou9434
    @omidghozatlou9434 3 года назад

    Thank you for your helpful tutorial. I want to select images (patches) by mouse clicking among multiple images that are shown in one window in Tkinter. Can you help me?

    • @Codemycom
      @Codemycom  3 года назад +1

      I don’t have any videos on that but you need binding and I have videos on that to get you started

  • @THIAGOFLAMINIO
    @THIAGOFLAMINIO 3 года назад +2

    Hello thinkers,
    first, thanks for the code.
    could you explain this code using " .create_rectangle" ?
    when I tried, I received strange behavior .. When i click the mouse and move it i drawing rectangles
    :(

    • @rggharwiom2102
      @rggharwiom2102 2 года назад

      Still looking for an answer 10 months later?

  • @RyanDanielG
    @RyanDanielG 3 года назад

    feed the algorithm! great vid

  • @laserbuddha
    @laserbuddha 3 года назад

    I got the code working, but the program isn't erasing the previous position of the image. So when you drag the image across the window the image is "smeared" all over the path you dragged the image.
    Any ideas how to fix this? Perhaps it's because I used an image that has part of it transparent?

  • @andrewgardner5687
    @andrewgardner5687 3 года назад

    Really enjoying these videos. Is there a place where we can get the finished code for each video ? It's kinda hard to use freeze frame and another tab to note things down.

    • @Codemycom
      @Codemycom  3 года назад

      github.com/flatplanet/Intro-To-TKinter-RUclips-Course

    • @andrewgardner5687
      @andrewgardner5687 3 года назад

      @@Codemycom grazie mille

  • @badrinarayana8434
    @badrinarayana8434 7 месяцев назад

    Can someone please tell me, Can we drag and drop the links in tkinter gui and it should be stored as Hyperlink as well ? Is this possible???

  • @brunorcabral
    @brunorcabral 3 года назад +4

    you don't need to us global or to recreate image every time...
    def mouse_drag_drop(event: tk.Event):
    x, y = my_canvas.coords(my_image)
    x, y = event.x - x, event.y - y
    my_canvas.move(my_image, x, y)

    • @RavensysteM
      @RavensysteM 2 года назад

      Thank you a lot saves a lot of computing!!

    • @david0411
      @david0411 Год назад +1

      Thank you! And how do you solve the problem of clicking on every part of the canvas without the image getting moved?

    • @infinity-hp1vr
      @infinity-hp1vr Год назад

      lifesaver, thank you so much!

  • @CTimmerman
    @CTimmerman 7 месяцев назад

    Won't create_image run out of reference numbers to return if you move long enough?

  • @guillermomartinez5051
    @guillermomartinez5051 3 года назад

    Hello, is there some video where you explain why could be slow when I create a windows with tkinter in a raspberry ?

  • @lunagherbi8356
    @lunagherbi8356 Год назад

    Can you do the same to move shapes on a canvas ?

  • @nikodemkarcz310
    @nikodemkarcz310 4 года назад

    Why when I do this but instead roof.bind i used frame.bind („frame” exists) its doesn’t work?

  • @AndruRomin
    @AndruRomin 4 года назад +1

    how would you check for collisions with the edge of the canvas?

    • @Codemycom
      @Codemycom  4 года назад +2

      Too much to type in a comment..maybe I'll do a video on it.

  • @dimitriosdesmos4699
    @dimitriosdesmos4699 4 года назад

    Thank you very much

  • @youvanced6593
    @youvanced6593 4 года назад

    How can I drag labels, buttons or other objects I create when I edit my GUI like in Windows-Forms-App? I mean without code.

    • @Codemycom
      @Codemycom  4 года назад

      You can't

    • @youvanced6593
      @youvanced6593 4 года назад

      @@Codemycom is there some other Python GUI where I can? or an IDLE that lets you?

    • @Codemycom
      @Codemycom  4 года назад

      @@youvanced6593 Not with tkinter

    • @youvanced6593
      @youvanced6593 4 года назад

      @@Codemycom thank you

  • @countdownstart8627
    @countdownstart8627 4 года назад

    can we do drag /resize and rotate and delete an image over a larger image in python ?? like we can do in android with using sticker-view library

    • @Codemycom
      @Codemycom  4 года назад

      not easily with tkinter

  • @Alinear285
    @Alinear285 4 года назад

    Hey I am working on a library with text animations for tkinter when I finish it can you make a tutorial about it?

    • @Codemycom
      @Codemycom  4 года назад +1

      Depends :-p

    • @Alinear285
      @Alinear285 4 года назад

      @@Codemycom I already have a type animation a reverse typ animation and a left slide animation. And I am working on other slide animations and some other animations if you have suggestions for animation i will try to implement them.

  • @arung.k7303
    @arung.k7303 4 года назад +1

    How can we open multiple images in the same canvas?

    • @Discodave676
      @Discodave676 3 года назад

      Either add then in separately, or use a for loop is they are named in a similar fashion

  • @Vic-mf1yr
    @Vic-mf1yr 4 года назад

    Nice video, thank you, but how can I Drag and Drop more than 1 item ? Like you say at the end of the video, when I click in my second image, it's the first one that come under my mouse, help please ;P

    • @Codemycom
      @Codemycom  4 года назад

      Would take too long to explain here, sorry.

    • @liamgaeuman4990
      @liamgaeuman4990 3 года назад

      @@Codemycom You should make a video. I'm trying to figure it out on my own and keep running into walls.

    • @erdiaz39
      @erdiaz39 3 года назад

      @@Codemycom can you tell us what to research to accomplish this please?

  • @bharaths1396
    @bharaths1396 4 года назад

    Hello Sir
    How would we drag and move the lines and rectangle that we created
    if i use move method it just gets disappeared
    please help

    • @Codemycom
      @Codemycom  4 года назад +1

      Might make a video about that :-)

    • @bharaths1396
      @bharaths1396 4 года назад

      @@Codemycom thank you sir

    • @Codemycom
      @Codemycom  4 года назад

      @@bharaths1396 no problem!

  • @itsikw
    @itsikw 3 года назад

    Is the code available for download?

    • @Codemycom
      @Codemycom  3 года назад +2

      github.com/flatplanet/Intro-To-TKinter-RUclips-Course

    • @itsikw
      @itsikw 3 года назад

      @@Codemycom Thank you very much, John

  • @alcryton6515
    @alcryton6515 3 года назад

    No video in discription 😤

    • @Codemycom
      @Codemycom  3 года назад

      Huh?

    • @alcryton6515
      @alcryton6515 3 года назад

      @@Codemycom you told link of previous video is in discription. And sorry for emoji I used to grap your attention.

    • @Codemycom
      @Codemycom  3 года назад

      @@alcryton6515 Yes, it's right there in the pinned comment as always. Link to the entire Tkinter playlist.