0
所以我有一个小应用程序,我想做一个整体BoxLayout的屏幕截图,并省略其他部分的父布局。Kivy截图布局或编号
注:这是一个Android应用程序
基本上我有这样的事情:
BoxLayout:
id: image_area
size_hint_y: 600
Image:
source: root.image_source
size: self.size
DragText:
background_color: (0, 0, 0, 0)
foreground_color: (255,255,255,255)
multiline: True
height: self.minimum_height
width: '400dp'
center: self.parent.center
text: 'Before'
font_size: '60px'
Image:
source: root.image_source2
DragText:
background_color: (0, 0, 0, 0)
foreground_color: (255,255,255,255)
multiline: True
height: self.minimum_height
width: '400dp'
center: self.parent.center
text: 'After'
font_size: '60px'
我有上面这一个,甚至父母等布局是一个盒子布局,但我只是想要截图这个布局,我遇到了麻烦。
我想:
def screenshot(self, widget):
widget.export_to_png('{0}.png'.format(datetime.now()))
但它不工作,任何想法我怎么能做到这一点?
我忘了指定这个,激活的截图按钮看起来像这样
Button:
size_hint_x: 2
text: 'Save'
on_release: root.screenshot(image_area)
谢谢,这有助于 – Nick
@Nick你是惠康
从kvlang直接 – EL3PHANTEN