test-kivy-app/kivy_venv/share/kivy-examples/cover/cover_image.py

26 lines
579 B
Python
Raw Normal View History

2024-09-15 12:12:16 +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.
"""
def __init__(self, **kwargs):
super(CoverImage, self).__init__(**kwargs)
texture = self._coreimage.texture
self.reference_size = texture.size
self.texture = texture
class MainApp(App):
def build(self):
return CoverImage(source='../widgets/cityCC0.png')
if __name__ == '__main__':
MainApp().run()