daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public Cairo.ImageSurface pixbuf2imgsurface(Gdk.Pixbuf pb) {
  2.     var fmt = pb.has_alpha ? Cairo.Format.ARGB32 : Cairo.Format.RGB24;
  3.     var imgsurface = new Cairo.ImageSurface(fmt, pb.width, pb.height);
  4.     var ctx = new Cairo.Context(imgsurface);
  5.     Gdk.cairo_set_source_pixbuf(ctx, pb, 0, 0);
  6.     ctx.paint();
  7.     return imgsurface;
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top