私はPython graphicsモジュールを使っています。私がしようとしているのは、現在のウィンドウをイメージとして保存することです。このモジュールには、「イメージ」をイメージ(image.save())として保存するオプションがあります。しかし、これはすでに読み込んだイメージを保存するだけで役に立ちません。または、空白のイメージを読み込むと、それを引き継ぎたいと思ったように、驚き、驚き:空白のイメージが保存されます。ここに私のコードは次のとおりです。ここではそうもう一度Pythonグラフィックスモジュールの操作:現在のウィンドウをイメージとして保存する方法はありますか?
from graphics import *
w = 300
h = 300
anchorpoint=Point(150,150)
height=300
width=300
image=Image(anchorpoint, height, width) #creates a blank image in the background
win = GraphWin("Red Circle", w, h)
# circle needs center x, y coordinates and radius
center = Point(150, 150)
radius = 80
circle = Circle(center, radius)
circle.setFill('red')
circle.setWidth(2)
circle.draw(win)
point= circle.getCenter()
print point
pointx= point.getX()
pointy= point.getY()
print pointx
print pointy
findPixel=image.getPixel(150,150)
print findPixel
image.save("blank.gif")
# wait, click mouse to go on/exit
win.getMouse()
win.close()
#######that's it#####
は私の問題です:どのように私は、「blank.gif」として画面上に今あるものを保存しない ありがとう!
ありがとうございます! – Dlinet