first commit

This commit is contained in:
Yura 2024-09-15 15:12:16 +03:00
commit 417e54da96
5696 changed files with 900003 additions and 0 deletions

View file

@ -0,0 +1,25 @@
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()

View file

@ -0,0 +1,31 @@
import kivy
from kivy.app import App
from kivy.uix.behaviors import CoverBehavior
from kivy.uix.video import Video
class CoverVideo(CoverBehavior, Video):
"""Video using cover behavior.
"""
def _on_video_frame(self, *largs):
video = self._video
if not video:
return
texture = video.texture
self.reference_size = texture.size
self.calculate_cover()
self.duration = video.duration
self.position = video.position
self.texture = texture
self.canvas.ask_update()
class MainApp(App):
def build(self):
return CoverVideo(source='../widgets/cityCC0.mpg', play=True)
if __name__ == '__main__':
MainApp().run()