tkinter-canvas

How do I get specific pixels of the tkinter canvas?

How do I get specific pixels of the tkinter canvas? Question: I have an issue with the Tkinter Canvas, saving it to an image, but more importantly, getting a specific pixel of the Tkinter Canvas. All I need is for that specific X, Y coordinate, I want its color value. By ‘color value’, any value …

Total answers: 2

How to Zoom and Pan Image in Python?

How to Zoom and Pan Image in Python? Question: I have an image: I wish to pick a point on this image. However, when I display the image, I can only see a part of it on the screen, as follows: I wish to know how to zoom out and pan the image in a …

Total answers: 1

Tkinter/Canvas-based kiosk-like program for Raspberry Pi

Tkinter/Canvas-based kiosk-like program for Raspberry Pi Question: I would like run a Python program on a Raspberry Pi (or, for that matter, any Unix/Linux-based computer) that effectively turns the entire screen into a canvas and allows me to draw text and graphics objects on it in real time. I ideally want this to also automatically …

Total answers: 2

Tkinter canvas zoom + move/pan

Tkinter canvas zoom + move/pan Question: Tkinter’s canvas widget has built-in features to: move/pan the canvas (for example with Click + Drag) with canvas.scan_mark and canvas.scan_dragto, see this question zoom the vector elements on the canvas with canvas.scale, but sadly, this doesn’t work for bitmap images on the canvas Fortunately, this method allows zooming of …

Total answers: 3

Python Tkinter, change specific row background colour?

Python Tkinter, change specific row background colour? Question: I’ve been able to change the background colour of the entire window and of specific labels through this, master.configure(background = ‘SteelBlue1’) titlelabel = Tkinter.Label(master, text=”my Title”, fg = “blue4”, bg = “gray80”).grid(row=0, column = 1) Is there a simple way to make row 0 gray instead of …

Total answers: 2

How do I position a button to a canvas, not to the screen using Tkinter 3

How do I position a button to a canvas, not to the screen using Tkinter 3 Question: I have a canvas with an image I’d like to use for a background. My problem is that when I position the button to the correct place, and I try to scroll down, the button moves with the …

Total answers: 1

Turtle freehand drawing

Turtle freehand drawing Question: I’m working on a simple drawing program that combines Tkinter and Turtle modules. I would like to add an option that the user can draw anything by just using mouse similar to pen widget on Paint. I tried many things, I could not figure out how l can do it.How can …

Total answers: 1

How to put an outline on a canvas text on python — tkinter?

How to put an outline on a canvas text on python — tkinter? Question: I’ve created a white text in the center of my canvas, but my background is very colorful and one part of it is a very light color, so some corners of my sentence doesn’t appear. I can’t find any options to …

Total answers: 2

python tkinter canvas not resizing

python tkinter canvas not resizing Question: I’m trying to subclass some tkinter controls to make an auto scrolling frame for use in my program, i only want it to scroll vertically, and when widgets are added that need it to scroll horizontally instead to resize the parent to fit. widgets that go in this frame …

Total answers: 2

Why is the function called before pressing a button?

Why is the function called before pressing a button? Question: My program draws the fractal using pointSize_max and pointSize variables, which are entered by the user in Tkinter. The problem is that the fractal is drawn before pressing a button (as soon as the program is run), and the program does not draw the fractal …

Total answers: 2