Use an image as a Widget.
wimg = Image(source='mylogo.png')
If you want to load your image in an asynchronous way, you may use the AsyncImage class. You can use it for loading external images on the web.
image = AsyncImage(source='http://mywebsite.com/logo.png')
By default, the image is centered and fitted inside the widget bounding box. If you don’t want that, we suggest you to inherit from Image, and create your own style.
For example, if you want your image to take the same size of your widget, you can do
class FullImage(Image):
pass
And in your kivy language file, you can do
<FullImage>:
canvas:
Color:
rgb: (1, 1, 1)
Rectangle:
texture: self.texture
size: self.size
pos: self.pos
Bases: kivy.uix.widget.Widget
Image class, see module documentation for more information.
Ratio of the image (width / float(height)
image_ratio is a AliasProperty, and is read-only.
Normalized image size withing the widget box.
This size will be always fitted to the widget size, and preserve the image ratio.
norm_image_size is a AliasProperty, and is read-only.
Filename / source of your image.
source a StringProperty, default to None.
Texture object of the image.
Depending of the texture creation, the value will be a Texture or TextureRegion object.
texture is a ObjectProperty, default to None.
Bases: kivy.uix.image.Image
Asynchronous Image class, see module documentation for more information.