New to Kivy. Is there a way to crop a square image to a circle one with kivy when presenting it? Thanks!
You can use a canvas and set it to Elipse as follow:
from kivy.app import App from kivy.lang import Builder kv = ''' BoxLayout: orientation: 'vertical' FloatLayout: canvas: Color: rgb: 1, 1, 1 Ellipse: pos: 280, 200 size: 200 , 200 source: 'image.jpg' angle_start: 0 angle_end: 360 ''' class App(App): def build(self): return Builder.load_string(kv) App().run()
from kivy.lang import Builder from kivymd.app import MDApp KV = ''' MDScreen: MDIconButton: icon: "data/logo/kivy-icon-512.png" ''' class Test(MDApp): def build(self): return Builder.load_string(KV) Test().run()
Copyright © 2021 Jogjafile Inc.
You can use a canvas and set it to Elipse as follow: