Use Tkinter to create GUI development tools (39) Special-shaped flower-shaped windows in Tkinter

Use Tkinter to create GUI development tools (39) Special-shaped flower-shaped windows
in Tkinter In the previous we introduced the Tkinter skin framework with pictures as the main body, see the previous article of the blog: Use Tkinter to create GUI development tools (23) Software window skins.
https://blog.csdn.net/hepu8/article/details/103592328 The
software skin can beautify the rustic Tkinter original window. But it provides us with a square window. Now there is a new question, can it be a round window?
Of course, the advanced Tkinter module HP_tk2 I developed supports this function.
What is the point of making a circular window? It makes no sense. We plan to make a petal window and a fish window.
The source code is given directly below.

#异形窗口演示
#独狼荷蒲qq:2775205
#通通小白python量化群:524949939
#电话微信:18578755056
#微信公众号:独狼股票分析

import tkinter  as tk
import HP_tk2 as htk

root = tk.Tk()
root.geometry('500x500+200+100')
def closewindow():
    root.destroy()

#花形窗口
sk=htk.Backskin(root,picture='img/hua2.png')
sk.bind('<ButtonRelease-3>', sk.onRightButtonUp) #鼠标右键关闭窗口
bt=tk.Button(root,text='Tkinter花形窗口')
bt.place(x=200,y=50)
bt2=tk.Button(root,text='X',command=closewindow)
bt2.place(x=390,y=110)

#鱼形窗口
top=tk.Toplevel(root)
top.geometry('500x300+200+100')
ska=htk.Backskin(top,picture='img/yu1.png')
ska.bind('<ButtonRelease-3>', sk.onRightButtonUp) #鼠标右键关闭窗口
bta=tk.Button(top,text='Tkinter鱼形窗口')
bta.place(x=50,y=130)
bt2a=tk.Button(top,text='X',command=closewindow)
bt2a.place(x=460,y=120)

root.mainloop()

The results of the program are as follows:
Insert picture description here
Are these 2 windows cool?
Improve yourself a bit, you can make a screen goddess scattered flower animation. It can also be made into a swimming fish.
Insert picture description here
The picture above is a picture resource of the fishing program. Change the background picture regularly and zoom the window size to realize the animation on the screen. Is it difficult to use Python and Tkinter modules to make QQ pet games?
Of course, our smart readers say that using the above method to be a QQ pet is too low-level.
Because our previous article introduced Tkinter's OpenGL components, you can implement 3D animation windows.
You can also directly use Tkinter's OpenCV component, or Tkinter's turtle component or Tkinter's Pygame component to directly display animation files, isn't it cooler?

Guess you like

Origin blog.csdn.net/hepu8/article/details/106583512