How To Use Kivy's Core Image?

45 views
Skip to first unread message

Tan Wang

unread,
Sep 29, 2015, 2:27:00 PM9/29/15
to Kivy users support

I have a grid layout and am adding to it some CoreImage widgets that I want to use for displaying pictures. I chose not to use uix.image since CoreImage is faster and I want to swap between a few pictures often.

When I do self.add_widget(CoreImage('Transparent.png')) my program will crash.


Traceback (most recent call last):
   File "/path/to/my/app.py", line 1030, in <module>
     MyApp().run()
   File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 798, in run
     root = self.build()
   File "/path/to/my/app.py", line 702, in build
     self.build_grid()
   File "/path/to/my/app.py", line 696, in build_grid
     self.grid.build_self()
   File "/path/to/my/app.py", line 134, in build_self
     self.add_widget(CoreImage('Transparent.png'))
   File "/usr/lib/python2.7/dist-packages/kivy/uix/layout.py", line 80, in add_widget
     size_hint=self._trigger_layout)
   File "_event.pyx", line 436, in kivy._event.EventDispatcher.bind (kivy/_event.c:5429)
 KeyError: 'size_hint'


When I add a Core Image to the app using the kv language, everything works fine, but I cannot seem to add it with self.add_widget(CoreImage('Transparent.png'))

Reply all
Reply to author
Forward
0 new messages