Re: Pixbuf to Cairo and vice versa

On 13.07.2011 15:41, Mario Kemper wrote:
3) Show the final image in a widget, i.e. convert the cairo surface back to a pixbuf

#write surface to pixbuf
my $loader = Gtk2::Gdk::PixbufLoader->new;
        sub {
                my ( $closure, $data ) = @_;

<<<  use $loader->get_pixbuf somewhere>>>

Maybe this approach is faster: <>?

Alternatively, if all you want is to display the altered image, then you could write a custom widget that uses the gdk and cairo integration stuff to draw the surface. Like described here: <>, or as is done here: <>. Use Cairo::set_source_surface to copy your surface into the widget's surface.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]