Extensions to gdk-pixbuf

Extensions to gdk-pixbuf — Miscelleanous extensions to the gdk-pixbuf library

Synopsis


#include <exo/exo.h>


GdkPixbuf*  exo_gdk_pixbuf_scale_down       (GdkPixbuf *source,
                                             gboolean aspect_ratio,
                                             gint dest_width,
                                             gint dest_height);
GdkPixbuf*  exo_gdk_pixbuf_scale_ratio      (GdkPixbuf *source,
                                             gint dest_size);

Description

This facility includes several functions to extend the basic functionality provided by the gdk-pixbuf library.

Details

exo_gdk_pixbuf_scale_down ()

GdkPixbuf*  exo_gdk_pixbuf_scale_down       (GdkPixbuf *source,
                                             gboolean aspect_ratio,
                                             gint dest_width,
                                             gint dest_height);

Scales down the source to fit into the given width and height. If aspect_ratio is TRUE then the aspect ratio of source will be preserved.

If width is larger than the width of source and height is larger than the height of source, a reference to source will be returned, as it's unneccesary then to scale down.

The caller is responsible to free the returned GdkPixbuf using g_object_unref() when no longer needed.

source : the source GdkPixbuf.
aspect_ratio : TRUE to preserve aspect ratio.
dest_width : the max width for the result.
dest_height : the max height for the result.
Returns : the resulting GdkPixbuf.

Since 0.3.1.1


exo_gdk_pixbuf_scale_ratio ()

GdkPixbuf*  exo_gdk_pixbuf_scale_ratio      (GdkPixbuf *source,
                                             gint dest_size);

Scales source to dest_size while preserving the aspect ratio of source.

source : The source GdkPixbuf.
dest_size : The target size in pixel.
Returns : A newly created GdkPixbuf.