test-kivy-app/kivy_venv/share/kivy-examples/cover/cover_image.py
2024-09-15 15:12:16 +03:00

26 lines
579 B
Python

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()