How to display an image using kivy

Rajeev picture Rajeev · May 14, 2014 · Viewed 19.1k times · Source

How do I display an image in my pwd?

import kivy
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.image import Image


class MyApp(App):
  def build(self):
    return Image('b1.png')

MyApp().run()

Answer

inclement picture inclement · May 14, 2014

You can check the Image documentation to see that the image source is controlled by the source property. Therefore you should be able to change just one line to make it work:

    return Image(source='b1.png')