Show Large Image using Scrollbar in Python

后端 未结 3 656
你的背包
你的背包 2021-01-06 17:50

I would like to display an image using tkinter (Python 3). The image is very long. Therefore, I would like to add a vertical scrollbar. This is what I have tried:

(b

3条回答
  •  孤城傲影
    2021-01-06 18:26

    Set the scroll region of the canvas after you draw the image:

    canvas.create_image(0, 0, image=img, anchor="nw")
    canvas.config(scrollregion=canvas.bbox(tkinter.ALL))
    

提交回复
热议问题