Advertisement
Guest User

Untitled

a guest
Dec 7th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. GdkPixbuf *ResizeImage(GdkPixbuf *pixbuf)
  2. {
  3.   int orig_width = gdk_pixbuf_get_width(pixbuf);
  4.   int orig_height = gdk_pixbuf_get_height(pixbuf);
  5.  
  6.   if (orig_width > 640 || orig_height > 480) {
  7.      orig_width = 640;
  8.      orig_height = 480;
  9.   }
  10.   GdkPixbuf *new_pixbuf = gdk_pixbuf_scale_simple(pixbuf, orig_width, orig_height, GDK_INTERP_BILINEAR);
  11.   return new_pixbuf;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement