我试图保存图像,但收到一条错误消息,说没有这样的文件或目录,即使我保存了图片。在import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
import ctypes, time
import urllib
while 1:
font_size = 50
font = ImageFont.load_default()
img = Image.open('bg.bmp')
draw = ImageDraw.Draw(img)
draw.text((300, 500), 'Period 1: ')
draw.text((300, 550), 'Period 2: ')
draw.text((300, 600), 'Period 3: ')
draw.text((300, 650), 'Period 4: ')
draw.text((300, 700), 'Period 5: ')
draw.text((300, 750), 'Period 6: ')
draw = ImageDraw.Draw(img)
draw = ImageDraw.Draw(img)
img.save("mod_bg.bmp")
pathToBmp = "C:\Documents and Settings\User\My Documents\My Pictures\ScreenShot.bmp"
SPI_SETDESKWALLPAPER = 20
ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, pathToBmp , 0)
quit()
这是错误消息
^{pr2}$