gdk_pixbuf_new_from_file_at_max_size


Description:


[ Version ( since = "4.21.0" ) ]
public Pixbuf gdk_pixbuf_new_from_file_at_max_size (string filename, int max_width, int max_height, bool preserve_aspect_ratio) throws Error

Creates a new Pixbuf by loading an image from the file at filename .

The file format is detected automatically. If null is returned, then throws will be set. Possible errors are in the PixbufError and FileError domains. If the image dimensions exceed max_width or max_height, the image will be scaled down to fit into the dimensions, optionally preservingthe image's aspect ratio. The image may still be larger, depending on the loader.

The advantage of using this function over Pixbuf.from_file_at_scale is that images will never be scaled up, whichwould otherwise result in ugly images.

Parameters:

filename

name of the file to load, in the GLib file name encoding.

max_width

the maximum width of the loaded image.

max_height

the maximum height of the loaded image.

preserve_aspect_ratio

true to preserve the image's aspect ratio while scaling to fit into max_width and max_height.

Returns:

a newly created Pixbuf with a reference count or 1, or null if any of several error conditions occurred: the file could not be opened, there was no loader for the file's format, there was not enough memory to allocate the buffer for the image, or the image file contained invalid data.


Namespace: Xfce
Package: libxfce4ui-2