set_from_file_async
Description:
Sets the image to display a GLib.File with requested width and height.
Note that this method is not a wrapper to the main Granite.AsyncImage.set_from_gicon_async method. Internally, it only creates a Gdk.Pixbuf with an GLib.InputStream, loads it asynchronously and sets the Gtk.Image's surface to the result.
This method will reset the Granite.AsyncImage.gicon_async and Granite.AsyncImage.size_async properties to their default values and will not make the Granite.AsyncImage update the image when the scale factor or icon theme changes.
For the time that the image is loaded, the size request of the AsyncImage will be set to width
and height
if
auto_size_request
is set to true
Parameters:
file |
the GLib.File to display in the image |
width |
the width of the final image, |
height |
the height of the final image, |
preserve_aspect_ratio |
|
cancellable |
the cancellable to stop loading the image |
Exceptions:
GLib.Error |
when the the file was not found or failed to load |