summaryrefslogtreecommitdiff
path: root/wallpapers.c
diff options
context:
space:
mode:
Diffstat (limited to 'wallpapers.c')
-rw-r--r--wallpapers.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/wallpapers.c b/wallpapers.c
index a4bfb60..0d37f5e 100644
--- a/wallpapers.c
+++ b/wallpapers.c
@@ -223,3 +223,18 @@ GdkPixbuf *resize_pixbuf(GdkPixbuf *orig, gint win_width, gint win_height, gint
return pb;
}
+
+GdkPixbuf *zoom_pixbuf(GdkPixbuf *orig, gdouble zoom) {
+ GdkPixbuf *pb;
+ gint img_width, img_height, width, height;
+
+ img_width = gdk_pixbuf_get_width(orig);
+ img_height = gdk_pixbuf_get_height(orig);
+
+ width = img_width * zoom;
+ height = img_height * zoom;
+ pb = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height);
+ gdk_pixbuf_scale(orig, pb, 0, 0, width, height, 0, 0,
+ (gdouble)width / (gdouble)img_width, (gdouble)height / (gdouble)img_height, GDK_INTERP_BILINEAR);
+ return pb;
+}