kivy/examples/cover/cover_image.py

26 lines
554 B
Python
Raw Normal View History

2016-12-22 12:28:50 +00:00
import kivy
from kivy.app import App
from kivy.uix.behaviors import CoverBehavior
from kivy.uix.image import Image
class CoverImage(CoverBehavior, Image):
"""Image using cover behavior.
2016-12-22 12:28:50 +00:00
"""
def __init__(self, **kwargs):
super(CoverImage, self).__init__(**kwargs)
texture = self._coreimage.texture
self.reference_size = texture.size
2016-12-22 12:28:50 +00:00
self.texture = texture
class MainApp(App):
def build(self):
return CoverImage(source='../widgets/cityCC0.png')
2016-12-22 12:28:50 +00:00
if __name__ == '__main__':
MainApp().run()