本文整理汇总了Python中kivy.core.image.Image.save方法的典型用法代码示例。如果您正苦于以下问题:Python Image.save方法的具体用法?Python Image.save怎么用?Python Image.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.core.image.Image
的用法示例。
在下文中一共展示了Image.save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: capture
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import save [as 别名]
def capture(self, event):
if (self.camera.play):
self.camera.play = False
img = Image(self.camera.texture)
img.save("capture.png")
self.captureButton.text="Take another"
self.classifyButton.disabled=False
else:
self.camera.play = True
self.captureButton.text="Capture"
self.classifyButton.disabled = True
示例2: _print_image
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import save [as 别名]
def _print_image(self, filename, *args, **kwargs):
"""Write out format png. The image is saved with the filename given.
"""
l, b, w, h = self.figure.bbox.bounds
img = None
if self.img_texture is None:
texture = Texture.create(size=(w, h))
texture.blit_buffer(bytes(self.get_renderer().buffer_rgba()), colorfmt="rgba", bufferfmt="ubyte")
texture.flip_vertical()
img = Image(texture)
else:
img = Image(self.img_texture)
img.save(filename)
示例3: print_png
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import save [as 别名]
def print_png(self, filename, *args, **kwargs):
'''Call the widget function to make a png of the widget.
'''
fig = FigureCanvasAgg(self.figure)
FigureCanvasAgg.draw(fig)
l, b, w, h = self.figure.bbox.bounds
texture = Texture.create(size=(w, h))
texture.blit_buffer(bytes(fig.get_renderer().buffer_rgba()),
colorfmt='rgba', bufferfmt='ubyte')
texture.flip_vertical()
img = Image(texture)
img.save(filename)
示例4: capture
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import save [as 别名]
def capture(self, event):
print("catpured")
self.tex = self.camera.texture
img = Image(texture=self.tex)
img.save("capture.png")