How To Add An Image To A Widget
Contents#
Intro#
Images in widgets are amazing! but how would one add an Image to a widget? In this tutorial we will be covering on how to add an one to a widget.
Loading An Image#
So to load an image through an url, you'll need to make a request. The best way to do this is by creating a function which will return our Image.
The loadImage function will return an Image object.
Showing An Image As A Background#
Now there are multiple ways to show an image in a widget. I'll be talking about one called backgroundImage
So if you would want to set it as a background, you'll just need 2 lines of code.
Adding An Image To A Stack#
If you don't want to set an image as background you can always add it to a stack.
Very easy to achieve this.
This will conclude our small tutorial regarding images in widgets.
