Signed-off-by: sairate <sairate@sina.cn>
This commit is contained in:
parent
e680fccb29
commit
0287890380
12
main.py
12
main.py
|
@ -1,7 +1,7 @@
|
|||
import turtle
|
||||
import random
|
||||
import time
|
||||
from PIL import Image
|
||||
#from PIL import Image
|
||||
|
||||
# 设置屏幕
|
||||
screen = turtle.Screen()
|
||||
|
@ -10,11 +10,11 @@ screen.bgcolor("black") # 背景色可以设置为黑色或其他
|
|||
screen.title("Snowfall Animation")
|
||||
screen.tracer(0)
|
||||
|
||||
# 加载 .jpg 图片并转换为 .gif 格式
|
||||
image_path = "dy.jpg"
|
||||
image = Image.open(image_path)
|
||||
# 将图片保存为 .gif 格式
|
||||
image.save("dy.gif", "GIF")
|
||||
## 加载 .jpg 图片并转换为 .gif 格式
|
||||
#image_path = "dy.jpg"
|
||||
#image = Image.open(image_path)
|
||||
## 将图片保存为 .gif 格式
|
||||
#image.save("dy.gif", "GIF")
|
||||
|
||||
# 设置背景图为 .gif 格式
|
||||
screen.bgpic("dy.gif")
|
||||
|
|
Loading…
Reference in New Issue