I have a small image file that I would like to make as the tiled background image on a tkinter canvas in Python 3.4. I want the image to repeat indefinitely even if the canvas window is resized. How can I go about implementing this?
Looking around on the internet leads me to believe that there isn't any native tkinter feature for doing this simply. Is there any "black-box" method in an image library that can interface with tkinter for doing this tiling? Or should I manually render copies of the image at regularly spaced coordinates?
Related
I am trying to create place a gif onto my tkinter canvas, however it is just a still image when it is placed.
Does anyone know how I could maybe place it but it moves when the code runs?
I am extremely new to Python and just started working in turtle contrary to tkinter.
I've been trying to make a borderless window using overridedirect(True) and making the background color
of the window transparent by using wm_attributes("-transparentcolor", "color") which I had to use "turtle.Screen().getcanvas()._root()" to be able to use the mentioned methods using turtle.
using the two methods indeed removes the window's border and turns the background of the window transparent although there seems to be a "frame" that so far I haven't found a way to remove nor did I manage to figure out(or find online) how to apply highlightthickness=0 to my code/in turtle.
I attached an image showing the undesired frame, any help would be appreciated.
Thanks in advance,
-Omri
Ended up making a Canvas, passed the Canvas into TurtleScreen and then passed TurtleScreen into RawTurtle.
Doing so allows me to draw analog clock hands using turtle on an analog clock image while still being able to make the window draggable,
with no border(without the undesired frame mentioned/linked above) and with a transparent background. Current clock
On my canvas, I am creating a large number of objects and images, and once loaded, the program finds it hard to maintain this large quantity and frequently crashes. A solution I thought up would be to convert the canvas into an image (perhaps using PIL?), clear the canvas and use canvas.create_image to paste the image-form of the original canvas. I am aware, and have found in similar questions, there are ways to convert the image to a png file/save the file on the PC - I do not want this - I want to turn the image into a PIL image or tkinter PhotoImage.
How can I go about doing this?
Thanks
After looking for answers all around, I find lots of help and guidance on how to save a file either using turtle screen or tkinter canvas mixed with the turtle module. I'm drawing a large image and the windows size is fine and scrollable, letting me see the entire image. But when I try to save the image to postscript, I only get the window view, not the entire canvas. Cannot find out how to proceed, any tips?
There might be an answer in How can I convert canvas content to an image? but I cannot see how to connect tkinter with turtle. Can someone elaborate on that?
I was wondering is there any way to export tkinter canvas as vector image or convert it to the vector image? Thanks.
Meanwhile I have found library called canvasvg. This might do the job for tkinter canvas and also for turtle canvas.