I'm working with python! the library is tkinter, but the thing is that I need to save the picture after adding to it a text( I don't want a text already written in the code and display it when I run the console).
For now, I used my picture as background and I added a text box to it.
This is my code:
from tkinter import *
from PIL import ImageTk
import cv2
#root = Tk()
image=cv2.imread("New_refImg.png")
width_1, height_1,channels = image.shape
print(width_1)
print(height_1)
canvas = Canvas(width =height_1, height = width_1, bg = 'blue')
canvas.pack(expand = 1, fill = BOTH)
img = ImageTk.PhotoImage(file = "New_refImg.png")
canvas.create_image(0, 0, image = img, anchor = NW)
#Add text
entry = Entry(canvas, width=12)
entry.pack(side=BOTTOM,padx=43,pady=height_1-130) # "side" position button
def onok():
x= entry.get().split('x')
print(x)
Button(canvas, text='OK', command=onok).pack(side=LEFT)
mainloop()
But it's not what I really need!
Do you have any idea what should I use instead or what should I do to make it better?
Thank you