Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Cairo.ImageSurface pixbuf2imgsurface(Gdk.Pixbuf pb) {
- var fmt = pb.has_alpha ? Cairo.Format.ARGB32 : Cairo.Format.RGB24;
- var imgsurface = new Cairo.ImageSurface(fmt, pb.width, pb.height);
- var ctx = new Cairo.Context(imgsurface);
- Gdk.cairo_set_source_pixbuf(ctx, pb, 0, 0);
- ctx.paint();
- return imgsurface;
- }
Add Comment
Please, Sign In to add comment