first commit
This commit is contained in:
commit
417e54da96
5696 changed files with 900003 additions and 0 deletions
Binary file not shown.
Binary file not shown.
25
kivy_venv/share/kivy-examples/cover/cover_image.py
Normal file
25
kivy_venv/share/kivy-examples/cover/cover_image.py
Normal 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()
|
31
kivy_venv/share/kivy-examples/cover/cover_video.py
Normal file
31
kivy_venv/share/kivy-examples/cover/cover_video.py
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue