I developed a small tkinter
GUI to display (and export) images stored in a proprietary format. I managed to load the data into a 3D numpy uint8
array. I want to display one slice of that 3D array in a tkinter.canvas
. To do so I used ImageTk.PhotoImage
.
Underneath the Canvas I inserted a tk.Scrollbar
. My goal is to use that scrollbar to let the user actively "scroll" though the 3D Array. Basically when the slider is moved or any of the arrows is pressed the slice corresponding to the slider position should be displayed in the canvas.
Right now I have the issue that I don't understand how to set the range of the scrollbar to my z-Dimension and then how to bind the scrollbar events to the movement or arrow actions to update the canvas.
Right now I don't have example code since this is a more conceptual problem.
Could you point me in the right direction how to solve this?
Best TMC
edit: Photo